mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 08:24:05 +01:00
Merge pull request #2093 from aaron-em/angleLineInterval
Add angleLineInterval option
This commit is contained in:
@@ -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.
|
||||
```
|
||||
```
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user