]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix stacked bar data limit calculation 1963/head
authorEvert Timberg <evert.timberg@gmail.com>
Mon, 1 Feb 2016 23:44:39 +0000 (18:44 -0500)
committerEvert Timberg <evert.timberg@gmail.com>
Mon, 1 Feb 2016 23:44:39 +0000 (18:44 -0500)
src/scales/scale.linear.js
test/scale.linear.tests.js

index 8c27785094516bef269f8e966b374c8c965f74ed..334e999ebac9635400efaa056e7a3303d0ec6ffb 100644 (file)
@@ -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);
index e21794fc89462d27961c27f6f6e9d89722d45cc3..a8b9738f9ae4a416bf65d139692abd0f6f68f565 100644 (file)
@@ -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);
        });