From 0e8babf1d7f8fa7f610c86393f19680c375435b7 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Mon, 1 Feb 2016 18:44:39 -0500 Subject: [PATCH] Fix stacked bar data limit calculation --- src/scales/scale.linear.js | 2 +- test/scale.linear.tests.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scales/scale.linear.js b/src/scales/scale.linear.js index 8c2778509..334e999eb 100644 --- a/src/scales/scale.linear.js +++ b/src/scales/scale.linear.js @@ -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); diff --git a/test/scale.linear.tests.js b/test/scale.linear.tests.js index e21794fc8..a8b9738f9 100644 --- a/test/scale.linear.tests.js +++ b/test/scale.linear.tests.js @@ -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); }); -- 2.47.2