From: Pascal Richier Date: Sat, 7 Nov 2015 00:39:30 +0000 (+0100) Subject: Add options.ticks.maxTicksLimit X-Git-Tag: 2.0.0-beta1~29^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5d63070c6f279b35f92acac53ea4f9a933ce8d9;p=thirdparty%2FChart.js.git Add options.ticks.maxTicksLimit To be able to change default '11' value --- diff --git a/src/scales/scale.radialLinear.js b/src/scales/scale.radialLinear.js index 75ef7a958..15fdb3626 100644 --- a/src/scales/scale.radialLinear.js +++ b/src/scales/scale.radialLinear.js @@ -101,7 +101,8 @@ // the axis area. For now, we say that the minimum tick spacing in pixels must be 50 // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on // the graph - var maxTicks = Math.min(11, Math.ceil(this.drawingArea / (1.5 * this.options.ticks.fontSize))); + var maxTicks = Math.min(this.options.ticks.maxTicksLimit ? this.options.ticks.maxTicksLimit : 11, + Math.ceil(this.drawingArea / (1.5 * this.options.ticks.fontSize))); maxTicks = Math.max(2, maxTicks); // Make sure we always have at least 2 ticks // To get a "nice" value for the tick spacing, we will use the appropriately named