mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 20:59:08 +02:00
Merge pull request #1963 from nnnick/fix/1952
Fix stacked bar data limit calculation
This commit is contained in:
commit
9ed88599d2
@ -85,7 +85,7 @@
|
||||
}, this);
|
||||
|
||||
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 maxVal = helpers.max(values)
|
||||
this.min = this.min === null ? minVal : Math.min(this.min, minVal);
|
||||
|
@ -207,7 +207,7 @@ describe('Linear Scale', function() {
|
||||
options.stacked = true;
|
||||
|
||||
scale.determineDataLimits();
|
||||
expect(scale.min).toBe(30);
|
||||
expect(scale.min).toBe(0);
|
||||
expect(scale.max).toBe(90);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user