File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ module.exports = function setPositions(gd, plotinfo) {
144144 for ( j = 0 ; j < ti . length ; j ++ ) {
145145 sv = Math . round ( ti [ j ] . p / sumround ) ;
146146 // store the negative sum value for p at the same key, with sign flipped
147- if ( relative && ti [ j ] . s < 0 ) sv = - Math . round ( ti [ j ] . p / sumround ) ;
147+ if ( relative && ti [ j ] . s < 0 ) sv = - sv ;
148148 var previousSum = sums [ sv ] || 0 ;
149149 if ( stack || relative ) ti [ j ] . b = previousSum ;
150150 barEnd = ti [ j ] . b + ti [ j ] . s ;
@@ -172,8 +172,8 @@ module.exports = function setPositions(gd, plotinfo) {
172172 ti = gd . calcdata [ bl [ i ] ] ;
173173 for ( j = 0 ; j < ti . length ; j ++ ) {
174174 relAndNegative = relative && ti [ j ] . s < 0 ;
175- sv = Math . round ( ti [ j ] . p / sumround ) ;
176- if ( relAndNegative ) sv = - Math . round ( ti [ j ] . p / sumround ) ; // locate negative sum amount for this p val
175+ sv = Math . round ( ti [ j ] . p / sumround ) ;
176+ if ( relAndNegative ) sv = - sv ; // locate negative sum amount for this p val
177177 scale = top / sums [ sv ] ;
178178 if ( relAndNegative ) scale *= - 1 ; // preserve sign if negative
179179 ti [ j ] . b *= scale ;
You can’t perform that action at this time.
0 commit comments