mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +02:00
Fix stacked bar data limit calculation
This commit is contained in:
parent
16dc9e6167
commit
0e8babf1d7
@ -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);
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user