From 681ada552ec3b965d80825b13f49f20d564edcc8 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com> Date: Sun, 7 Nov 2021 20:31:31 +0100 Subject: [PATCH] Docs/update scale position type (#9812) * update type of scale position in docs, add explanation sentence to object position * improve clarification * grammar/spelling --- docs/axes/cartesian/_common.md | 2 +- docs/axes/cartesian/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/axes/cartesian/_common.md b/docs/axes/cartesian/_common.md index a9082b55fd5..1050a85a2a6 100644 --- a/docs/axes/cartesian/_common.md +++ b/docs/axes/cartesian/_common.md @@ -5,7 +5,7 @@ Namespace: `options.scales[scaleId]` | Name | Type | Default | Description | ---- | ---- | ------- | ----------- | `bounds` | `string` | `'ticks'` | Determines the scale bounds. [more...](./index.md#scale-bounds) -| `position` | `string` | | Position of the axis. [more...](./index.md#axis-position) +| `position` | `string` \| `object` | | Position of the axis. [more...](./index.md#axis-position) | `stack` | `string` | | Stack group. Axes at the same `position` with same `stack` are stacked. | `stackWeight` | `number` | 1 | Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group. | `axis` | `string` | | Which type of axis this is. Possible values are: `'x'`, `'y'`. If not set, this is inferred from the first character of the ID which should be `'x'` or `'y'`. diff --git a/docs/axes/cartesian/index.md b/docs/axes/cartesian/index.md index 6054f4d84a7..e33dc105cf6 100644 --- a/docs/axes/cartesian/index.md +++ b/docs/axes/cartesian/index.md @@ -201,7 +201,7 @@ module.exports = { An axis can either be positioned at the edge of the chart, at the center of the chart area, or dynamically with respect to a data value. To position the axis at the edge of the chart, set the `position` option to one of: `'top'`, `'left'`, `'bottom'`, `'right'`. -To position the axis at the center of the chart area, set the `position` option to `'center'`. In this mode, either the `axis` option is specified or the axis ID starts with the letter 'x' or 'y'. +To position the axis at the center of the chart area, set the `position` option to `'center'`. In this mode, either the `axis` option must be specified or the axis ID has to start with the letter 'x' or 'y'. This is so chart.js knows what kind of axis (horizontal or vertical) it is. To position the axis with respect to a data value, set the `position` option to an object such as: ```javascript