Skip to content

Commit a422525

Browse files
s-heapSimonHeap
authored andcommitted
Added "- marginTop" in the _convertAreaToCoordinates function when enableX and enableY are set to account for the vertical margin and prevent inaccuracies in y selection.
1 parent 80a0331 commit a422525

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plot/highlight.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ class Highlight extends AbstractSeries {
9090

9191
if (enableX && enableY) {
9292
return {
93-
bottom: yScale.invert(brushArea.bottom),
93+
bottom: yScale.invert(brushArea.bottom - marginTop),
9494
left: xScale.invert(brushArea.left - marginLeft),
9595
right: xScale.invert(brushArea.right - marginLeft),
96-
top: yScale.invert(brushArea.top)
96+
top: yScale.invert(brushArea.top - marginTop)
9797
};
9898
}
9999

0 commit comments

Comments
 (0)