Skip to content

Commit b4732da

Browse files
committed
bar: interpret trace data as sizes
1 parent 5d4c84a commit b4732da

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/traces/bar/calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = function calc(gd, trace) {
7878
// set size
7979
for(i = 0; i < cd.length; i++) {
8080
if(isNumeric(size[i])) {
81-
cd[i].s = size[i] - cd[i].b;
81+
cd[i].s = size[i];
8282
}
8383
}
8484

src/traces/bar/set_positions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ function stackBars(gd, sa, sieve) {
499499
if(!isNumeric(bar.s)) continue;
500500

501501
// stack current bar and get previous sum
502-
var barBase = sieve.put(bar.p, bar.b + bar.s),
502+
var barBase = sieve.put(bar.p, bar.s),
503503
barTop = barBase + bar.s;
504504

505505
// store the bar base and top in each calcdata item
@@ -538,7 +538,7 @@ function sieveBars(gd, sa, sieve) {
538538
for(var j = 0; j < trace.length; j++) {
539539
var bar = trace[j];
540540

541-
if(isNumeric(bar.s)) sieve.put(bar.p, bar.b + bar.s);
541+
if(isNumeric(bar.s)) sieve.put(bar.p, bar.s);
542542
}
543543
}
544544
}
@@ -566,7 +566,7 @@ function normalizeBars(gd, sa, sieve) {
566566

567567
if(!isNumeric(bar.s)) continue;
568568

569-
var scale = Math.abs(sTop / sieve.get(bar.p, bar.b + bar.s));
569+
var scale = Math.abs(sTop / sieve.get(bar.p, bar.s));
570570
bar.b *= scale;
571571
bar.s *= scale;
572572

0 commit comments

Comments
 (0)