Skip to content

Commit a23f1de

Browse files
authored
Rename scaleLabel to title in scale options (#8576)
1 parent e3cdd73 commit a23f1de

32 files changed

+149
-147
lines changed

docs/docs/axes/cartesian/_common.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Namespace: `options.scales[scaleId]`
88
| `position` | `string` | | Position of the axis. [more...](./index.mdx#axis-position)
99
| `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'`.
1010
| `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 bar chart by default.
11-
| `scaleLabel` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
11+
| `title` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)

docs/docs/axes/labelling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ When creating a chart, you want to tell the viewer what data they are viewing. T
66

77
## Scale Title Configuration
88

9-
Namespace: `options.scales[scaleId].scaleLabel`, it defines options for the scale title. Note that this only applies to cartesian axes.
9+
Namespace: `options.scales[scaleId].title`, it defines options for the scale title. Note that this only applies to cartesian axes.
1010

1111
| Name | Type | Default | Description
1212
| ---- | ---- | ------- | -----------
1313
| `display` | `boolean` | `false` | If true, display the axis title.
1414
| `align` | `string` | `'center'` | Alignment of the axis title. Possible options are `'start'`, `'center'` and `'end'`
15-
| `labelString` | `string` | `''` | The text for the title. (i.e. "# of People" or "Response Choices").
15+
| `text` | `string` | `''` | The text for the title. (i.e. "# of People" or "Response Choices").
1616
| `color` | [`Color`](../general/colors.md) | `Chart.defaults.color` | Color of label.
1717
| `font` | `Font` | `Chart.defaults.font` | See [Fonts](../general/fonts.md)
1818
| `padding` | `number`\|`object` | `4` | Padding to apply around scale labels. Only `top` and `bottom` are implemented.

docs/docs/getting-started/v3-migration.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ A number of changes were made to the configuration options passed to the `Chart`
8585
* `scales.[x/y]Axes.categoryPercentage` was moved to dataset option `categoryPercentage`
8686
* `scales.[x/y]Axes.maxBarThickness` was moved to dataset option `maxBarThickness`
8787
* `scales.[x/y]Axes.minBarLength` was moved to dataset option `minBarLength`
88+
* `scales.[x/y]Axes.scaleLabel` was renamed to `scales[id].title`
89+
* `scales.[x/y]Axes.scaleLabel.labelString` was renamed to `scales[id].title.text`
8890
* `scales.[x/y]Axes.ticks.beginAtZero` was renamed to `scales[id].beginAtZero`
8991
* `scales.[x/y]Axes.ticks.max` was renamed to `scales[id].max`
9092
* `scales.[x/y]Axes.ticks.min` was renamed to `scales[id].min`
@@ -134,9 +136,9 @@ options: {
134136
id: 'x',
135137
type: 'time',
136138
display: true,
137-
scaleLabel: {
139+
title: {
138140
display: true,
139-
labelString: 'Date'
141+
text: 'Date'
140142
},
141143
ticks: {
142144
major: {
@@ -155,9 +157,9 @@ options: {
155157
yAxes: [{
156158
id: 'y',
157159
display: true,
158-
scaleLabel: {
160+
title: {
159161
display: true,
160-
labelString: 'value'
162+
text: 'value'
161163
}
162164
}]
163165
}
@@ -172,9 +174,9 @@ options: {
172174
x: {
173175
type: 'time',
174176
display: true,
175-
scaleLabel: {
177+
title: {
176178
display: true,
177-
labelString: 'Date'
179+
text: 'Date'
178180
},
179181
ticks: {
180182
major: {
@@ -192,9 +194,9 @@ options: {
192194
},
193195
y: {
194196
display: true,
195-
scaleLabel: {
197+
title: {
196198
display: true,
197-
labelString: 'value'
199+
text: 'value'
198200
}
199201
}
200202
}

samples/advanced/line-gradient.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@
8686
scales: {
8787
x: {
8888
display: true,
89-
scaleLabel: {
89+
title: {
9090
display: true,
91-
labelString: 'Month'
91+
text: 'Month'
9292
}
9393
},
9494
y: {
9595
display: true,
96-
scaleLabel: {
96+
title: {
9797
display: true,
98-
labelString: 'Value'
98+
text: 'Value'
9999
}
100100
}
101101
}

samples/animations/drop.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@
100100
scales: {
101101
x: {
102102
display: true,
103-
scaleLabel: {
103+
title: {
104104
display: true,
105-
labelString: 'Month'
105+
text: 'Month'
106106
}
107107
},
108108
y: {
109109
display: true,
110-
scaleLabel: {
110+
title: {
111111
display: true,
112-
labelString: 'Value'
112+
text: 'Value'
113113
}
114114
}
115115
}

samples/animations/loop.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@
8989
scales: {
9090
x: {
9191
display: true,
92-
scaleLabel: {
92+
title: {
9393
display: true,
94-
labelString: 'Month'
94+
text: 'Month'
9595
}
9696
},
9797
y: {
9898
display: true,
99-
scaleLabel: {
99+
title: {
100100
display: true,
101-
labelString: 'Value'
101+
text: 'Value'
102102
}
103103
}
104104
}

samples/charts/area/line-stacked.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@
105105
},
106106
scales: {
107107
x: {
108-
scaleLabel: {
108+
title: {
109109
display: true,
110-
labelString: 'Month'
110+
text: 'Month'
111111
}
112112
},
113113
y: {
114114
stacked: true,
115-
scaleLabel: {
115+
title: {
116116
display: true,
117-
labelString: 'Value'
117+
text: 'Value'
118118
}
119119
}
120120
}

samples/charts/line/basic.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@
8080
scales: {
8181
x: {
8282
display: true,
83-
scaleLabel: {
83+
title: {
8484
display: true,
85-
labelString: 'Month'
85+
text: 'Month'
8686
}
8787
},
8888
y: {
8989
display: true,
90-
scaleLabel: {
90+
title: {
9191
display: true,
92-
labelString: 'Value'
92+
text: 'Value'
9393
}
9494
}
9595
}

samples/charts/line/interpolation-modes.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@
6969
scales: {
7070
x: {
7171
display: true,
72-
scaleLabel: {
72+
title: {
7373
display: true
7474
}
7575
},
7676
y: {
7777
display: true,
78-
scaleLabel: {
78+
title: {
7979
display: true,
80-
labelString: 'Value'
80+
text: 'Value'
8181
},
8282
suggestedMin: -10,
8383
suggestedMax: 200

samples/charts/line/line-styles.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@
8787
scales: {
8888
x: {
8989
display: true,
90-
scaleLabel: {
90+
title: {
9191
display: true,
92-
labelString: 'Month'
92+
text: 'Month'
9393
}
9494
},
9595
y: {
9696
display: true,
97-
scaleLabel: {
97+
title: {
9898
display: true,
99-
labelString: 'Value'
99+
text: 'Value'
100100
}
101101
}
102102
}

0 commit comments

Comments
 (0)