Fix stacked bar data limit calculation

This commit is contained in:
Evert Timberg 2016-02-01 18:44:39 -05:00
parent 16dc9e6167
commit 0e8babf1d7
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@
}, this); }, this);
helpers.each(valuesPerType, function(valuesForType) { helpers.each(valuesPerType, function(valuesForType) {
var values = hasPositiveValues ? hasNegativeValues ? valuesForType.positiveValues.concat(valuesForType.negativeValues) : valuesForType.positiveValues : valuesForType.negativeValues; var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);
var minVal = helpers.min(values); var minVal = helpers.min(values);
var maxVal = helpers.max(values) var maxVal = helpers.max(values)
this.min = this.min === null ? minVal : Math.min(this.min, minVal); this.min = this.min === null ? minVal : Math.min(this.min, minVal);

View File

@ -207,7 +207,7 @@ describe('Linear Scale', function() {
options.stacked = true; options.stacked = true;
scale.determineDataLimits(); scale.determineDataLimits();
expect(scale.min).toBe(30); expect(scale.min).toBe(0);
expect(scale.max).toBe(90); expect(scale.max).toBe(90);
}); });