Merge pull request #2093 from aaron-em/angleLineInterval

Add angleLineInterval option
This commit is contained in:
Evert Timberg
2016-03-13 10:09:43 -04:00
3 changed files with 9 additions and 2 deletions

View 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.
```
```

View File

@@ -2059,7 +2059,7 @@
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();

View 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'",
@@ -181,6 +184,7 @@
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,