You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/axes/styling.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,26 @@ The grid line configuration is nested under the scale configuration in the `grid
10
10
| ---- | ---- | ------- | -----------
11
11
| `display` | `boolean` | `true` | If false, do not display grid lines for this axis.
12
12
| `circular` | `boolean` | `false` | If true, gridlines are circular (on radar chart only).
13
-
| `color` | <code>Color|Color[]</code> | `'rgba(0, 0, 0, 0.1)'` | The color of the grid lines. If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on.
13
+
| `color` | <code>Color|Color[]|function</code> | `'rgba(0, 0, 0, 0.1)'` | The color of the grid lines. If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on.
14
14
| `borderDash` | `number[]` | `[]` | Length and spacing of dashes on grid lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash).
15
-
| `borderDashOffset` | `number` | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
| `borderDashOffset` | <code>number|function</code> | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
| `drawBorder` | `boolean` | `true` | If true, draw border at the edge between the axis and the chart area.
18
18
| `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.
19
19
| `drawTicks` | `boolean` | `true` | If true, draw lines beside the ticks in the axis area beside the chart.
20
20
| `tickMarkLength` | `number` | `10` | Length in pixels that the grid lines will draw into the axis area.
21
21
| `offsetGridLines` | `boolean` | `false` | If true, grid lines will be shifted to be between labels. This is set to `true` for a bar chart by default.
22
22
| `z` | `number` | `0` | z-index of gridline layer. Values <= 0 are drawn under datasets, > 0 on top.
23
23
24
+
For function arguments, the function is passed a context object that is of the form:
25
+
26
+
```javscript
27
+
{
28
+
scale: // Scale object
29
+
tick: // Tick object
30
+
}
31
+
```
32
+
24
33
## Tick Configuration
25
34
The tick configuration is nested under the scale configuration in the `ticks` key. It defines options for the tick marks that are generated by the axis.
0 commit comments