mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Radial linear scale array properties for line width and color
This commit is contained in:
parent
5f7865c741
commit
a687749ed4
@ -44,8 +44,8 @@ The grid line configuration is nested under the scale configuration in the `grid
|
||||
Name | Type | Default | Description
|
||||
--- | --- | --- | ---
|
||||
display | Boolean | true |
|
||||
color | Color | "rgba(0, 0, 0, 0.1)" | Color of the grid lines.
|
||||
lineWidth | Number | 1 | Stroke width of grid lines
|
||||
color | Color or Array[Color] | "rgba(0, 0, 0, 0.1)" | Color of the grid lines.
|
||||
lineWidth | Number or Array[Number] | 1 | Stroke width of grid lines
|
||||
drawBorder | Boolean | true | If true draw border on the edge of the chart
|
||||
drawOnChartArea | Boolean | true | If true, draw lines on the chart area inside the axis lines. This is useful when there are multiple axes and you need to control which grid lines are drawn
|
||||
drawTicks | Boolean | true | If true, draw lines beside the ticks in the axis area beside the chart.
|
||||
|
@ -66,6 +66,9 @@
|
||||
},
|
||||
scale: {
|
||||
reverse: false,
|
||||
gridLines: {
|
||||
color: ['black', 'red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
|
||||
},
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
|
@ -296,9 +296,9 @@ module.exports = function(Chart) {
|
||||
var yHeight = me.yCenter - yCenterOffset;
|
||||
|
||||
// Draw circular lines around the scale
|
||||
if (gridLineOpts.display) {
|
||||
ctx.strokeStyle = gridLineOpts.color;
|
||||
ctx.lineWidth = gridLineOpts.lineWidth;
|
||||
if (gridLineOpts.display && index !== 0) {
|
||||
ctx.strokeStyle = helpers.getValueAtIndexOrDefault(gridLineOpts.color, index - 1);
|
||||
ctx.lineWidth = helpers.getValueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);
|
||||
|
||||
if (opts.lineArc) {
|
||||
// Draw circular arcs between the points
|
||||
|
Loading…
Reference in New Issue
Block a user