Skip to content

Commit dcc5aee

Browse files
keeganmccallumetpinard
authored andcommitted
fix issue with bar releative mode when first bucket is 0 or string
1 parent 46bbbae commit dcc5aee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/traces/bar/set_positions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module.exports = function setPositions(gd, plotinfo) {
149149

150150
sv = Math.round(ti[j].p / sumround);
151151
// store the negative sum value for p at the same key, with sign flipped
152-
if(relative && ti[j].s < 0) sv = -sv;
152+
if(relative && ti[j].s < 0) sv = '-'+sv; // use string to ensure -0 !== 0
153153
var previousSum = sums[sv] || 0;
154154
if(stack || relative) ti[j].b = previousSum;
155155
barEnd = ti[j].b + ti[j].s;

0 commit comments

Comments
 (0)