Skip to content

Commit 1c32bc5

Browse files
authored
Merge pull request #1163 from n-riesco/pr-20161117-fix-issue-1157
Fix hover label in stacked bars
2 parents 564f661 + 8472254 commit 1c32bc5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/traces/bar/hover.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,18 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
6565
if(Color.opacity(mc)) pointData.color = mc;
6666
else if(Color.opacity(mlc) && mlw) pointData.color = mlc;
6767

68+
var size = (trace.base) ? di.b + di.s : di.s;
6869
if(trace.orientation === 'h') {
6970
pointData.x0 = pointData.x1 = xa.c2p(di.x, true);
70-
pointData.xLabelVal = di.b + di.s;
71+
pointData.xLabelVal = size;
7172

7273
pointData.y0 = ya.c2p(barPos(di) - barDelta, true);
7374
pointData.y1 = ya.c2p(barPos(di) + barDelta, true);
7475
pointData.yLabelVal = di.p;
7576
}
7677
else {
7778
pointData.y0 = pointData.y1 = ya.c2p(di.y, true);
78-
pointData.yLabelVal = di.b + di.s;
79+
pointData.yLabelVal = size;
7980

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

0 commit comments

Comments
 (0)