From: Jacco van den Berg Date: Wed, 27 Jul 2022 20:16:32 +0000 (+0200) Subject: Improve docs radial linear grid (#10518) X-Git-Tag: v3.9.0~9 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c6120f9e7143c66d5e7a1b4052ae3b0f1165d5da;p=thirdparty%2FChart.js.git Improve docs radial linear grid (#10518) * make link work in github itself * fix dead link on reload or new tab * document the props for radial grid * remove extra chart and space --- diff --git a/docs/axes/radial/linear.md b/docs/axes/radial/linear.md index 6e0c681bf..8e6e11c0c 100644 --- a/docs/axes/radial/linear.md +++ b/docs/axes/radial/linear.md @@ -18,7 +18,25 @@ Namespace: `options.scales[scaleId]` | `pointLabels` | `object` | | Point label configuration. [more...](#point-label-options) | `startAngle` | `number` | `0` | Starting angle of the scale. In degrees, 0 is at top. -!!!include(axes/_common.md)!!! +### Common options to all axes + +Namespace: `options.scales[scaleId]` + +| Name | Type | Default | Description +| ---- | ---- | ------- | ----------- +| `type` | `string` | | Type of scale being employed. Custom scales can be created and registered with a string key. This allows changing the type of an axis for a chart. +| `alignToPixels` | `boolean` | `false` | Align pixel values to device pixels. +| `backgroundColor` | [`Color`](/general/colors.md) | | Background color of the scale area. +| `display` | `boolean`\|`string` | `true` | Controls the axis global visibility (visible when `true`, hidden when `false`). When `display: 'auto'`, the axis is visible only if at least one associated dataset is visible. +| `grid` | `object` | | Grid line configuration. [more...](#grid-line-configuration) +| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](/axes/index.md#axis-range-settings) +| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](/axes/index.md#axis-range-settings) +| `reverse` | `boolean` | `false` | Reverse the scale. +| `stacked` | `boolean`\|`string` | `false` | Should the data be stacked. [more...](/axes/index.md#stacking) +| `suggestedMax` | `number` | | Adjustment used when calculating the maximum data value. [more...](/axes/index.md#axis-range-settings) +| `suggestedMin` | `number` | | Adjustment used when calculating the minimum data value. [more...](/axes/index.md#axis-range-settings) +| `ticks` | `object` | | Tick configuration. [more...](/axes/index.md#tick-configuration) +| `weight` | `number` | `0` | The weight used to sort the axis. Higher weights are further away from the chart area. ## Tick Configuration @@ -38,6 +56,21 @@ Namespace: `options.scales[scaleId].ticks` The scriptable context is described in [Options](../../general/options.md#tick) section. +## Grid Line Configuration + +Namespace: `options.scales[scaleId].grid`, it defines options for the grid lines of the axis. + +| Name | Type | Scriptable | Indexable | Default | Description +| ---- | ---- | :-------------------------------: | :-----------------------------: | ------- | ----------- +| `borderDash` | `number[]` | | | `[]` | Length and spacing of dashes on grid lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash). +| `borderDashOffset` | `number` | Yes | | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset). +| `circular` | `boolean` | | | `false` | If true, gridlines are circular (on radar and polar area charts only). +| `color` | [`Color`](../general/colors.md) | Yes | Yes | `Chart.defaults.borderColor` | 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. +| `display` | `boolean` | | | `true` | If false, do not display grid lines for this axis. +| `lineWidth` | `number` | Yes | Yes | `1` | Stroke width of grid lines. + +The scriptable context is described in [Options](../general/options.md#tick) section. + ## Axis Range Settings Given the number of axis range settings, it is important to understand how they all interact with each other. diff --git a/docs/axes/styling.md b/docs/axes/styling.md index 9af53d3b2..19cd93b38 100644 --- a/docs/axes/styling.md +++ b/docs/axes/styling.md @@ -12,7 +12,7 @@ Namespace: `options.scales[scaleId].grid`, it defines options for the grid lines | `borderWidth` | `number` | | | `1` | The width of the border line. | `borderDash` | `number[]` | Yes | | `[]` | Length and spacing of dashes on grid lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash). | `borderDashOffset` | `number` | Yes | | `0.0` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset). -| `circular` | `boolean` | | | `false` | If true, gridlines are circular (on radar chart only). +| `circular` | `boolean` | | | `false` | If true, gridlines are circular (on radar and polar area charts only). | `color` | [`Color`](../general/colors.md) | Yes | Yes | `Chart.defaults.borderColor` | 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. | `display` | `boolean` | | | `true` | If false, do not display grid lines for this axis. | `drawBorder` | `boolean` | | | `true` | If true, draw a border at the edge between the axis and the chart area.