]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Docs/update scale position type (#9812)
authorJacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
Sun, 7 Nov 2021 19:31:31 +0000 (20:31 +0100)
committerGitHub <noreply@github.com>
Sun, 7 Nov 2021 19:31:31 +0000 (21:31 +0200)
* update type of scale position in docs, add explanation sentence to object position

* improve clarification

* grammar/spelling

docs/axes/cartesian/_common.md
docs/axes/cartesian/index.md

index a9082b55fd5f905aa817578bc5e1e14ddf3709b6..1050a85a2a624d328b7d91f1b8527601ea283ad6 100644 (file)
@@ -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'`.
index 6054f4d84a7e9da9ecaa2945534a776a2dab1f8c..e33dc105cf6ee38f6b7eec1015ca38a96c364458 100644 (file)
@@ -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