]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add options.ticks.maxTicksLimit
authorPascal Richier <pascoual@users.noreply.github.com>
Sat, 7 Nov 2015 00:39:30 +0000 (01:39 +0100)
committerPascal Richier <pascoual@users.noreply.github.com>
Sat, 7 Nov 2015 00:39:30 +0000 (01:39 +0100)
To be able to change default '11' value

src/scales/scale.radialLinear.js

index 75ef7a9585bd7fb7837a5560b924397c91999f80..15fdb36269672488706033687f2d225cfb890efe 100644 (file)
                        // 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