]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add angleLineInterval option to radar chart 2093/head
authorAaron Miller <me@aaron-miller.me>
Sun, 13 Mar 2016 13:59:19 +0000 (09:59 -0400)
committerAaron Miller <me@aaron-miller.me>
Sun, 13 Mar 2016 13:59:19 +0000 (09:59 -0400)
docs/03-Radar-Chart.md
src/Chart.Core.js
src/Chart.Radar.js

index aff5a00db279a3a12a477700f75587805106ad8c..35b3244e8bf734454b98b6adc6b872348869d6fa 100644 (file)
@@ -76,6 +76,9 @@ These are the customisation options specific to Radar charts. These options are
        //Number - Pixel width of the angle line
        angleLineWidth : 1,
 
+       //Number - Interval at which to draw angle lines ("every Nth point")
+       angleLineInterval: 1,
+      
        //String - Point label font declaration
        pointLabelFontFamily : "'Arial'",
 
@@ -174,4 +177,4 @@ Calling `removeData()` on your Chart instance will remove the first value for al
 ```javascript
 myRadarChart.removeData();
 // Other points will now animate to their correct positions.
-```
\ No newline at end of file
+```
index 979a91b7ca46d3bb4cee1439d317a315b4b0e99e..3fb3b2ca4541085f059f12099d110835fafcbb98 100755 (executable)
                                        for (var i = this.valuesCount - 1; i >= 0; i--) {
                                                var centerOffset = null, outerPosition = null;
 
-                                               if (this.angleLineWidth > 0){
+                                               if (this.angleLineWidth > 0 && (i % this.angleLineInterval === 0)){
                                                        centerOffset = this.calculateCenterOffset(this.max);
                                                        outerPosition = this.getPointPosition(i, centerOffset);
                                                        ctx.beginPath();
index 93d7352fd9838f399ec725e979159649c6d30d10..c45e0976134e66edad980516983d9efb23c19bb4 100644 (file)
@@ -28,6 +28,9 @@
                        //Number - Pixel width of the angle line
                        angleLineWidth : 1,
 
+                       //Number - Interval at which to draw angle lines ("every Nth point")
+                       angleLineInterval: 1,
+
                        //String - Point label font declaration
                        pointLabelFontFamily : "'Arial'",
 
                                lineColor: this.options.scaleLineColor,
                                angleLineColor : this.options.angleLineColor,
                                angleLineWidth : (this.options.angleShowLineOut) ? this.options.angleLineWidth : 0,
+        angleLineInterval: (this.options.angleLineInterval) ? this.options.angleLineInterval : 1,
                                // Point labels at the edge of each line
                                pointLabelFontColor : this.options.pointLabelFontColor,
                                pointLabelFontSize : this.options.pointLabelFontSize,