From ee59057fefa76f4b85d9d85a7e90af6e06898956 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Wed, 20 Jul 2022 18:34:06 +0200 Subject: [PATCH 1/4] make link work in github itself --- docs/getting-started/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md index ea8ef96f21d..c75e4b60646 100644 --- a/docs/getting-started/index.md +++ b/docs/getting-started/index.md @@ -101,6 +101,6 @@ module.exports = { As you can see, some of the boilerplate needed is not visible in our sample blocks, as the samples focus on the configuration options. ::: -All our examples are [available online](/samples/). +All our examples are [available online](../samples/). To run the samples locally you first have to install all the necessary packages using the `npm ci` command, after this you can run `npm run docs:dev` to build the documentation. As soon as the build is done, you can go to [http://localhost:8080/samples/](http://localhost:8080/samples/) to see the samples. From 61a3864b93398e321e2e8a3c76cb6b2250725fa5 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Mon, 25 Jul 2022 01:02:58 +0200 Subject: [PATCH 2/4] fix dead link on reload or new tab --- docs/axes/labelling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/axes/labelling.md b/docs/axes/labelling.md index 9ab75ffaba0..5f613b6f81b 100644 --- a/docs/axes/labelling.md +++ b/docs/axes/labelling.md @@ -31,7 +31,7 @@ The call to the method is scoped to the scale. `this` inside the method is the s If the callback returns `null` or `undefined` the associated grid line will be hidden. :::tip -The [category axis](../axes/cartesian/category), which is the default x-axis for line and bar charts, uses the `index` as internal data format. For accessing the label, use `this.getLabelForValue(value)`. [API: getLabelForValue](../api/classes/scale.html#getlabelforvalue) +The [category axis](../axes/cartesian/category), which is the default x-axis for line and bar charts, uses the `index` as internal data format. For accessing the label, use `this.getLabelForValue(value)`. [API: getLabelForValue](../api/classes/Scale.html#getlabelforvalue) ::: In the following example, every label of the Y-axis would be displayed with a dollar sign at the front. From 8d181bd499084ecc5f3fa2b7641fe755c6ad40cc Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Mon, 25 Jul 2022 21:37:59 +0200 Subject: [PATCH 3/4] document the props for radial grid --- docs/axes/radial/linear.md | 35 ++++++++++++++++++++++++++++++++++- docs/axes/styling.md | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/docs/axes/radial/linear.md b/docs/axes/radial/linear.md index 6e0c681bfa9..8e6e11c0c46 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 f74d258e2d4..c09a97971f3 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[]` | | | `[]` | 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 chart 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. From f6854975c63c0af699bcb1aa55caa14563c11adb Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Mon, 25 Jul 2022 22:08:11 +0200 Subject: [PATCH 4/4] remove extra chart and space --- docs/axes/styling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/axes/styling.md b/docs/axes/styling.md index c09a97971f3..de993e82e15 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[]` | | | `[]` | 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 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.