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/README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ The following properties are common to all axes provided by Chart.js.
16
16
17
17
| Name | Type | Default | Description
18
18
| ---- | ---- | ------- | -----------
19
-
| `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.
20
-
| `callbacks` | `Object` | | Callback functions to hook into the axis lifecycle. [more...](#callbacks)
21
-
| `weight` | `Number` | `0` | The weight used to sort the axis. Higher weights are further away from the chart area.
19
+
| `display` | <code>boolean|string</code> | `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.
20
+
| `callbacks` | `object` | | Callback functions to hook into the axis lifecycle. [more...](#callbacks)
21
+
| `weight` | `number` | `0` | The weight used to sort the axis. Higher weights are further away from the chart area.
22
22
23
23
## Callbacks
24
24
There are a number of config callbacks that can be used to change parameters in the scale at different points in the update process.
Copy file name to clipboardExpand all lines: docs/axes/cartesian/README.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -12,27 +12,27 @@ Axes that follow a cartesian grid are known as 'Cartesian Axes'. Cartesian axes
12
12
All of the included cartesian axes support a number of common options.
13
13
14
14
| Name | Type | Default | Description
15
-
| -----| ---- | --------| -----------
16
-
| `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.
17
-
| `position` | `String` | | Position of the axis in the chart. Possible values are: `'top'`, `'left'`, `'bottom'`, `'right'`
18
-
| `offset` | `Boolean` | `false` | If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to `true` for a category scale in a bar chart by default.
19
-
| `id` | `String` | | The ID is used to link datasets and scale axes together. [more...](#axis-id)
20
-
| `gridLines` | `Object` | | Grid line configuration. [more...](../styling.md#grid-line-configuration)
21
-
| `scaleLabel` | `Object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
| `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.
17
+
| `position` | `string` | | Position of the axis in the chart. Possible values are: `'top'`, `'left'`, `'bottom'`, `'right'`
18
+
| `offset` | `boolean` | `false` | If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to `true` for a category scale in a bar chart by default.
19
+
| `id` | `string` | | The ID is used to link datasets and scale axes together. [more...](#axis-id)
20
+
| `gridLines` | `object` | | Grid line configuration. [more...](../styling.md#grid-line-configuration)
21
+
| `scaleLabel` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
The following options are common to all cartesian axes but do not apply to other axes.
26
26
27
27
| Name | Type | Default | Description
28
-
| -----| ---- | --------| -----------
29
-
| `autoSkip` | `Boolean` | `true` | If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter what.
30
-
| `autoSkipPadding` | `Number` | `0` | Padding between the ticks on the horizontal axis when `autoSkip` is enabled. *Note: Only applicable to horizontal scales.*
31
-
| `labelOffset` | `Number` | `0` | Distance in pixels to offset the label from the centre point of the tick (in the x direction for the x axis, and the y direction for the y axis). *Note: this can cause labels at the edges to be cropped by the edge of the canvas*
32
-
| `maxRotation` | `Number` | `90` | Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. *Note: Only applicable to horizontal scales.*
33
-
| `minRotation` | `Number` | `0` | Minimum rotation for tick labels. *Note: Only applicable to horizontal scales.*
34
-
| `mirror` | `Boolean` | `false` | Flips tick labels around axis, displaying the labels inside the chart instead of outside. *Note: Only applicable to vertical scales.*
35
-
| `padding` | `Number` | `10` | Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.
28
+
| ----| ---- | -------| -----------
29
+
| `autoSkip` | `boolean` | `true` | If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter what.
30
+
| `autoSkipPadding` | `number` | `0` | Padding between the ticks on the horizontal axis when `autoSkip` is enabled. *Note: Only applicable to horizontal scales.*
31
+
| `labelOffset` | `number` | `0` | Distance in pixels to offset the label from the centre point of the tick (in the x direction for the x axis, and the y direction for the y axis). *Note: this can cause labels at the edges to be cropped by the edge of the canvas*
32
+
| `maxRotation` | `number` | `90` | Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. *Note: Only applicable to horizontal scales.*
33
+
| `minRotation` | `number` | `0` | Minimum rotation for tick labels. *Note: Only applicable to horizontal scales.*
34
+
| `mirror` | `boolean` | `false` | Flips tick labels around axis, displaying the labels inside the chart instead of outside. *Note: Only applicable to vertical scales.*
35
+
| `padding` | `number` | `10` | Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.
36
36
37
37
## Axis ID
38
38
The properties `dataset.xAxisID` or `dataset.yAxisID` have to match the scale properties `scales.xAxes.id` or `scales.yAxes.id`. This is especially needed if multi-axes charts are used.
Copy file name to clipboardExpand all lines: docs/axes/cartesian/category.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
If global configuration is used, labels are drawn from one of the label arrays included in the chart data. If only `data.labels` is defined, this will be used. If `data.xLabels` is defined and the axis is horizontal, this will be used. Similarly, if `data.yLabels` is defined and the axis is vertical, this property will be used. Using both `xLabels` and `yLabels` together can create a chart that uses strings for both the X and Y axes.
4
4
5
-
Specifying any of the settings above defines the x axis as `type: category` if not defined otherwise. For more fine-grained control of category labels it is also possible to add `labels` as part of the category axis definition. Doing so does not apply the global defaults.
5
+
Specifying any of the settings above defines the x axis as `type: 'category'` if not defined otherwise. For more fine-grained control of category labels it is also possible to add `labels` as part of the category axis definition. Doing so does not apply the global defaults.
The category scale provides the following options for configuring tick marks. They are nested in the `ticks` sub object. These options extend the [common tick configuration](README.md#tick-configuration).
40
40
41
41
| Name | Type | Default | Description
42
-
| -----| ---- | --------| -----------
43
-
| `labels` | `Array[String]` | - | An array of labels to display.
44
-
| `min` | `String` | | The minimum item to display. [more...](#min-max-configuration)
45
-
| `max` | `String` | | The maximum item to display. [more...](#min-max-configuration)
42
+
| ----| ---- | -------| -----------
43
+
| `labels` | `string[]` | - | An array of labels to display.
44
+
| `min` | `string` | | The minimum item to display. [more...](#min-max-configuration)
45
+
| `max` | `string` | | The maximum item to display. [more...](#min-max-configuration)
46
46
47
47
## Min Max Configuration
48
48
For both the `min` and `max` properties, the value must be in the `labels` array. In the example below, the x axis would only display "March" through "June".
Copy file name to clipboardExpand all lines: docs/axes/cartesian/linear.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ The linear scale is use to chart numerical data. It can be placed on either the
7
7
The following options are provided by the linear scale. They are all located in the `ticks` sub options. These options extend the [common tick configuration](README.md#tick-configuration).
8
8
9
9
| Name | Type | Default | Description
10
-
| -----| ---- | --------| -----------
11
-
| `beginAtZero` | `Boolean` | | if true, scale will include 0 if it is not already included.
12
-
| `min` | `Number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](#axis-range-settings)
13
-
| `max` | `Number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](#axis-range-settings)
14
-
| `maxTicksLimit` | `Number` | `11` | Maximum number of ticks and gridlines to show.
15
-
| `precision` | `Number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places.
16
-
| `stepSize` | `Number` | | User defined fixed step size for the scale. [more...](#step-size)
17
-
| `suggestedMax` | `Number` | | Adjustment used when calculating the maximum data value. [more...](#axis-range-settings)
18
-
| `suggestedMin` | `Number` | | Adjustment used when calculating the minimum data value. [more...](#axis-range-settings)
10
+
| ----| ---- | -------| -----------
11
+
| `beginAtZero` | `boolean` | | if true, scale will include 0 if it is not already included.
12
+
| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](#axis-range-settings)
13
+
| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](#axis-range-settings)
14
+
| `maxTicksLimit` | `number` | `11` | Maximum number of ticks and gridlines to show.
15
+
| `precision` | `number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places.
16
+
| `stepSize` | `number` | | User defined fixed step size for the scale. [more...](#step-size)
17
+
| `suggestedMax` | `number` | | Adjustment used when calculating the maximum data value. [more...](#axis-range-settings)
18
+
| `suggestedMin` | `number` | | Adjustment used when calculating the minimum data value. [more...](#axis-range-settings)
19
19
20
20
## Axis Range Settings
21
21
@@ -56,7 +56,7 @@ let chart = new Chart(ctx, {
56
56
In contrast to the `suggested*` settings, the `min` and `max` settings set explicit ends to the axes. When these are set, some data points may not be visible.
57
57
58
58
## Step Size
59
-
If set, the scale ticks will be enumerated by multiple of stepSize, having one tick per increment. If not set, the ticks are labeled automatically using the nice numbers algorithm.
59
+
If set, the scale ticks will be enumerated by multiple of `stepSize`, having one tick per increment. If not set, the ticks are labeled automatically using the nice numbers algorithm.
60
60
61
61
This example sets up a chart with a y axis that creates ticks at `0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5`.
Copy file name to clipboardExpand all lines: docs/axes/cartesian/logarithmic.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,6 @@ The logarithmic scale is use to chart numerical data. It can be placed on either
7
7
The following options are provided by the logarithmic scale. They are all located in the `ticks` sub options. These options extend the [common tick configuration](README.md#tick-configuration).
8
8
9
9
| Name | Type | Default | Description
10
-
| -----| ---- | --------| -----------
11
-
| `min` | `Number` | | User defined minimum number for the scale, overrides minimum value from data.
12
-
| `max` | `Number` | | User defined maximum number for the scale, overrides maximum value from data.
10
+
| ----| ---- | -------| -----------
11
+
| `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data.
12
+
| `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data.
0 commit comments