Skip to content

Commit 9a0143f

Browse files
committed
bar hover: fix spikedistance calculation
1 parent ae7db42 commit 9a0143f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/traces/bar/hover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function hoverOnBars(pointData, xval, yval, hovermode) {
161161
pointData.valueLabel = hoverLabelText(sa, pointData[sizeLetter + 'LabelVal']);
162162

163163
// spikelines always want "closest" distance regardless of hovermode
164-
pointData.spikeDistance = (sizeFn(di) + thisBarPositionFn(di)) / 2 + maxSpikeDistance - maxHoverDistance;
164+
pointData.spikeDistance = (sizeFn(di) + thisBarPositionFn(di)) / 2;
165165
// they also want to point to the data value, regardless of where the label goes
166166
// in case of bars shifted within groups
167167
pointData[posLetter + 'Spike'] = pa.c2p(di.p, true);

0 commit comments

Comments
 (0)