Skip to content

Commit 864dd9e

Browse files
committed
bar: fix hover label
* Fix hover xLabelVal and yLabelVal so that it takes into account the bar base.
1 parent 6aa7adc commit 864dd9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/traces/bar/hover.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
6767

6868
if(trace.orientation === 'h') {
6969
pointData.x0 = pointData.x1 = xa.c2p(di.x, true);
70-
pointData.xLabelVal = di.s;
70+
pointData.xLabelVal = di.b + di.s;
7171

7272
pointData.y0 = ya.c2p(barPos(di) - barDelta, true);
7373
pointData.y1 = ya.c2p(barPos(di) + barDelta, true);
7474
pointData.yLabelVal = di.p;
7575
}
7676
else {
7777
pointData.y0 = pointData.y1 = ya.c2p(di.y, true);
78-
pointData.yLabelVal = di.s;
78+
pointData.yLabelVal = di.b + di.s;
7979

8080
pointData.x0 = xa.c2p(barPos(di) - barDelta, true);
8181
pointData.x1 = xa.c2p(barPos(di) + barDelta, true);

0 commit comments

Comments
 (0)