From: Morley Zhi Date: Thu, 7 Jan 2016 17:37:13 +0000 (-0500) Subject: Looks like maxTicksLimit already limits gridlines, so restore this X-Git-Tag: v2.0.0~78^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf695734c40b906152787f49955142872098d6a;p=thirdparty%2FChart.js.git Looks like maxTicksLimit already limits gridlines, so restore this --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index d9fa3f92f..acee9222b 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -432,14 +432,6 @@ var scaleLabelY; var useAutoskipper = this.options.ticks.autoSkip; - - // figure out the maximum number of gridlines to show - var maxTicks; - - if (this.options.ticks.maxTicksLimit) { - maxTicks = this.options.ticks.maxTicksLimit; - } - // Make sure we draw text in the correct color and font this.ctx.fillStyle = this.options.ticks.fontColor; var labelFont = helpers.fontString(this.options.ticks.fontSize, this.options.ticks.fontStyle, this.options.ticks.fontFamily); @@ -462,23 +454,10 @@ if (!useAutoskipper) { skipRatio = false; } - - // if they defined a max number of ticks, - // increase skipRatio until that number is met - if (maxTicks) { - while (!skipRatio || this.ticks.length / (skipRatio || 1) > maxTicks) { - if (!skipRatio) { - skipRatio = 1; - } - skipRatio += 1; - } - } helpers.each(this.ticks, function(label, index) { // Blank ticks - var isLastTick = this.ticks.length == index + 1; - var shouldSkip = skipRatio > 1 && index % skipRatio > 0; - if (shouldSkip && !isLastTick || (label === undefined || label === null)) { + if ((skipRatio > 1 && index % skipRatio > 0) || (label === undefined || label === null)) { return; } var xLineValue = this.getPixelForTick(index); // xvalues for grid lines