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/charts/line.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ If the `steppedLine` value is set to anything other than false, `lineTension` wi
166
166
167
167
## Configuration Options
168
168
169
-
The line chart defines the following configuration options. These options are merged with the global chart configuration options, `Chart.defaults.global`, to form the options passed to the chart.
169
+
The line chart defines the following configuration options. These options are merged with the global chart configuration options, `Chart.defaults`, to form the options passed to the chart.
Copy file name to clipboardExpand all lines: docs/charts/radar.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ The interaction with each point can be controlled with the following properties:
155
155
156
156
## Configuration Options
157
157
158
-
The radar chart defines the following configuration options. These options are merged with the global chart configuration options, `Chart.defaults.global`, to form the options passed to the chart.
158
+
The radar chart defines the following configuration options. These options are merged with the global chart configuration options, `Chart.defaults`, to form the options passed to the chart.
Copy file name to clipboardExpand all lines: docs/configuration/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,12 @@ The configuration is used to change how the chart behaves. There are properties
6
6
7
7
This concept was introduced in Chart.js 1.0 to keep configuration [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself), and allow for changing options globally across chart types, avoiding the need to specify options for each instance, or the default for a particular chart type.
8
8
9
-
Chart.js merges the options object passed to the chart with the global configuration using chart type defaults and scales defaults appropriately. This way you can be as specific as you would like in your individual chart configuration, while still changing the defaults for all chart types where applicable. The global general options are defined in `Chart.defaults.global`. The defaults for each chart type are discussed in the documentation for that chart type.
9
+
Chart.js merges the options object passed to the chart with the global configuration using chart type defaults and scales defaults appropriately. This way you can be as specific as you would like in your individual chart configuration, while still changing the defaults for all chart types where applicable. The global general options are defined in `Chart.defaults`. The defaults for each chart type are discussed in the documentation for that chart type.
10
10
11
11
The following example would set the hover mode to 'nearest' for all charts where this was not overridden by the chart type defaults or the options passed to the constructor on creation.
12
12
13
13
```javascript
14
-
Chart.defaults.global.hover.mode='nearest';
14
+
Chart.defaults.hover.mode='nearest';
15
15
16
16
// Hover mode is set to nearest because it was not overridden here
17
17
var chartHoverModeNearest =newChart(ctx, {
@@ -38,7 +38,7 @@ Options may be configured directly on the dataset. The dataset options can be ch
38
38
39
39
- per dataset: dataset.*
40
40
- per chart: options.datasets[type].*
41
-
- or globally: Chart.defaults.global.datasets[type].*
41
+
- or globally: Chart.defaults.datasets[type].*
42
42
43
43
where type corresponds to the dataset type.
44
44
@@ -48,7 +48,7 @@ The following example would set the `showLine` option to 'false' for all line da
Copy file name to clipboardExpand all lines: docs/configuration/elements.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,16 @@ While chart types provide settings to configure the styling of each dataset, you
4
4
5
5
## Global Configuration
6
6
7
-
The element options can be specified per chart or globally. The global options for elements are defined in `Chart.defaults.global.elements`. For example, to set the border width of all bar charts globally you would do:
7
+
The element options can be specified per chart or globally. The global options for elements are defined in `Chart.defaults.elements`. For example, to set the border width of all bar charts globally you would do:
Copy file name to clipboardExpand all lines: docs/configuration/layout.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Layout Configuration
2
2
3
-
The layout configuration is passed into the `options.layout` namespace. The global options for the chart layout is defined in `Chart.defaults.global.layout`.
3
+
The layout configuration is passed into the `options.layout` namespace. The global options for the chart layout is defined in `Chart.defaults.layout`.
Copy file name to clipboardExpand all lines: docs/configuration/legend.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The chart legend displays data about the datasets that are appearing on the char
4
4
5
5
## Configuration options
6
6
7
-
The legend configuration is passed into the `options.legend` namespace. The global options for the chart legend is defined in `Chart.defaults.global.legend`.
7
+
The legend configuration is passed into the `options.legend` namespace. The global options for the chart legend is defined in `Chart.defaults.legend`.
8
8
9
9
| Name | Type | Default | Description
10
10
| ---- | ---- | ------- | -----------
@@ -138,7 +138,7 @@ function(e, legendItem) {
138
138
Lets say we wanted instead to link the display of the first two datasets. We could change the click handler accordingly.
139
139
140
140
```javascript
141
-
var defaultLegendClickHandler =Chart.defaults.global.legend.onClick;
141
+
var defaultLegendClickHandler =Chart.defaults.legend.onClick;
Copy file name to clipboardExpand all lines: docs/configuration/title.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
The chart title defines text to draw at the top of the chart.
4
4
5
5
## Title Configuration
6
-
The title configuration is passed into the `options.title` namespace. The global options for the chart title is defined in `Chart.defaults.global.title`.
6
+
The title configuration is passed into the `options.title` namespace. The global options for the chart title is defined in `Chart.defaults.title`.
Copy file name to clipboardExpand all lines: docs/configuration/tooltip.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Tooltip Configuration
4
4
5
-
The tooltip configuration is passed into the `options.tooltips` namespace. The global options for the chart tooltips is defined in `Chart.defaults.global.tooltips`.
5
+
The tooltip configuration is passed into the `options.tooltips` namespace. The global options for the chart tooltips is defined in `Chart.defaults.tooltips`.
0 commit comments