Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Anderson, Danny H
gist-charts
Commits
5552865f
Commit
5552865f
authored
Sep 13, 2018
by
Chris Tester
Browse files
Scatter chart margin bug potential fix
parent
69bf0ccf
Changes
2
Hide whitespace changes
Inline
Side-by-side
demo-angularIO/src/app/scatterchart-demo/scatterchart-demo.component.ts
View file @
5552865f
...
...
@@ -76,6 +76,7 @@ export class ScatterChartDemoComponent {
bottomAxis
.
shouldExtendTicksAcrossChart
=
true
;
let
selectedData
:
DataPoint
[]
=
[];
baseChart
.
margin
=
5
;
selectionChart
.
datalist
(
selectedData
);
me
.
chart
.
addChart
(
baseChart
);
me
.
chart
.
addChart
(
selectionChart
);
...
...
@@ -100,7 +101,7 @@ export class ScatterChartDemoComponent {
}
},
3
5
);
let
zoom
=
new
ZoomBehavior
();
// zoom.limitZoom( axis, 0.5, 1.5 );
...
...
gist-charts/source/implementations/charts/scatterChartImplementation.class.ts
View file @
5552865f
...
...
@@ -53,7 +53,8 @@ export class ScatterChartImplementation extends BaseChartImplementation {
public
getDataAtCoord
(
px
:
number
,
py
:
number
,
closeEnough
:
number
):
DataPoint
[]
{
let
activePoints
:
Array
<
Point
>
=
[];
px
+=
this
.
chart
.
margin
;
py
+=
this
.
chart
.
margin
;
let
xi
=
px
-
closeEnough
,
xo
=
px
+
closeEnough
,
yi
=
py
-
closeEnough
,
yo
=
py
+
closeEnough
;
this
.
quadTree
.
visit
((
node
:
any
,
x0
,
y0
,
x1
,
y1
)
=>
{
if
(
!
node
.
length
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment