Scale expansion if min === max will only occur after ticks.beginAtZero is handled

This commit is contained in:
etimberg 2015-10-27 20:04:21 -04:00
parent 85572d7b67
commit 988034cef6

View File

@ -100,12 +100,6 @@
}, this); }, this);
} }
if (this.min === this.max) {
this.min--;
this.max++;
}
// Then calulate the ticks // Then calulate the ticks
this.ticks = []; this.ticks = [];
@ -146,6 +140,11 @@
} }
} }
if (this.min === this.max) {
this.min--;
this.max++;
}
var niceRange = helpers.niceNum(this.max - this.min, false); var niceRange = helpers.niceNum(this.max - this.min, false);
var spacing = helpers.niceNum(niceRange / (maxTicks - 1), true); var spacing = helpers.niceNum(niceRange / (maxTicks - 1), true);
var niceMin = Math.floor(this.min / spacing) * spacing; var niceMin = Math.floor(this.min / spacing) * spacing;