Skip to content

Commit 0d01bcf

Browse files
nagixsimonbrunel
authored andcommitted
Fix typos and make the docs consistent (#6020)
1 parent 72b7a61 commit 0d01bcf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+696
-684
lines changed

docs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ In this example, we create a bar chart for a single dataset and render that in o
1414
```html
1515
<canvas id="myChart" width="400" height="400"></canvas>
1616
<script>
17-
var ctx = document.getElementById("myChart").getContext('2d');
17+
var ctx = document.getElementById('myChart').getContext('2d');
1818
var myChart = new Chart(ctx, {
1919
type: 'bar',
2020
data: {
21-
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
21+
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
2222
datasets: [{
2323
label: '# of Votes',
2424
data: [12, 19, 3, 5, 2, 3],
@@ -31,7 +31,7 @@ var myChart = new Chart(ctx, {
3131
'rgba(255, 159, 64, 0.2)'
3232
],
3333
borderColor: [
34-
'rgba(255,99,132,1)',
34+
'rgba(255, 99, 132, 1)',
3535
'rgba(54, 162, 235, 1)',
3636
'rgba(255, 206, 86, 1)',
3737
'rgba(75, 192, 192, 1)',
@@ -45,7 +45,7 @@ var myChart = new Chart(ctx, {
4545
scales: {
4646
yAxes: [{
4747
ticks: {
48-
beginAtZero:true
48+
beginAtZero: true
4949
}
5050
}]
5151
}

docs/axes/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ The following properties are common to all axes provided by Chart.js.
1616

1717
| Name | Type | Default | Description
1818
| ---- | ---- | ------- | -----------
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&#124;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.
2222

2323
## Callbacks
2424
There are a number of config callbacks that can be used to change parameters in the scale at different points in the update process.

docs/axes/cartesian/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ Axes that follow a cartesian grid are known as 'Cartesian Axes'. Cartesian axes
1212
All of the included cartesian axes support a number of common options.
1313

1414
| 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)
22-
| `ticks` | `Object` | | Tick configuration. [more...](#tick-configuration)
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)
22+
| `ticks` | `object` | | Tick configuration. [more...](#tick-configuration)
2323

2424
## Tick Configuration
2525
The following options are common to all cartesian axes but do not apply to other axes.
2626

2727
| 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.
3636

3737
## Axis ID
3838
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.
@@ -84,7 +84,7 @@ var myChart = new Chart(ctx, {
8484
label: 'Right dataset',
8585

8686
// This binds the dataset to the right y axis
87-
yAxisID: 'right-y-axis',
87+
yAxisID: 'right-y-axis'
8888
}],
8989
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
9090
},

docs/axes/cartesian/category.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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.
44

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.
66

77
## Category Axis Definition
88

@@ -14,7 +14,7 @@ let chart = new Chart(ctx, {
1414
data: {
1515
labels: ['January', 'February', 'March', 'April', 'May', 'June'],
1616
datasets: ...
17-
},
17+
}
1818
});
1919
```
2020
As part of axis definition:
@@ -27,7 +27,7 @@ let chart = new Chart(ctx, {
2727
scales: {
2828
xAxes: [{
2929
type: 'category',
30-
labels: ['January', 'February', 'March', 'April', 'May', 'June'],
30+
labels: ['January', 'February', 'March', 'April', 'May', 'June']
3131
}]
3232
}
3333
}
@@ -39,10 +39,10 @@ let chart = new Chart(ctx, {
3939
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).
4040

4141
| 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)
4646

4747
## Min Max Configuration
4848
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".
@@ -54,7 +54,7 @@ let chart = new Chart(ctx, {
5454
datasets: [{
5555
data: [10, 20, 30, 40, 50, 60]
5656
}],
57-
labels: ['January', 'February', 'March', 'April', 'May', 'June'],
57+
labels: ['January', 'February', 'March', 'April', 'May', 'June']
5858
},
5959
options: {
6060
scales: {

docs/axes/cartesian/linear.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ The linear scale is use to chart numerical data. It can be placed on either the
77
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).
88

99
| 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)
1919

2020
## Axis Range Settings
2121

@@ -56,7 +56,7 @@ let chart = new Chart(ctx, {
5656
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.
5757

5858
## 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.
6060

6161
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`.
6262

@@ -72,4 +72,4 @@ let options = {
7272
}]
7373
}
7474
};
75-
```
75+
```

docs/axes/cartesian/logarithmic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ The logarithmic scale is use to chart numerical data. It can be placed on either
77
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).
88

99
| 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

Comments
 (0)