From a422525c0ef1eaa63d873bd918b99636338fe61f Mon Sep 17 00:00:00 2001 From: Simon Heap Date: Wed, 4 Sep 2019 10:30:44 +0100 Subject: [PATCH] Added "- marginTop" in the _convertAreaToCoordinates function when enableX and enableY are set to account for the vertical margin and prevent inaccuracies in y selection. --- src/plot/highlight.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plot/highlight.js b/src/plot/highlight.js index 57802b6ba..b271edb09 100644 --- a/src/plot/highlight.js +++ b/src/plot/highlight.js @@ -90,10 +90,10 @@ class Highlight extends AbstractSeries { if (enableX && enableY) { return { - bottom: yScale.invert(brushArea.bottom), + bottom: yScale.invert(brushArea.bottom - marginTop), left: xScale.invert(brushArea.left - marginLeft), right: xScale.invert(brushArea.right - marginLeft), - top: yScale.invert(brushArea.top) + top: yScale.invert(brushArea.top - marginTop) }; }