Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/axes/cartesian/_common.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Namespace: `options.scales[scaleId]`
| `position` | `string` | | Position of the axis. [more...](./index.mdx#axis-position)
| `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'`.
| `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.
| `scaleLabel` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
| `title` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
4 changes: 2 additions & 2 deletions docs/docs/axes/labelling.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ When creating a chart, you want to tell the viewer what data they are viewing. T

## Scale Title Configuration

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

| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| `display` | `boolean` | `false` | If true, display the axis title.
| `align` | `string` | `'center'` | Alignment of the axis title. Possible options are `'start'`, `'center'` and `'end'`
| `labelString` | `string` | `''` | The text for the title. (i.e. "# of People" or "Response Choices").
| `text` | `string` | `''` | The text for the title. (i.e. "# of People" or "Response Choices").
| `color` | [`Color`](../general/colors.md) | `Chart.defaults.color` | Color of label.
| `font` | `Font` | `Chart.defaults.font` | See [Fonts](../general/fonts.md)
| `padding` | `number`\|`object` | `4` | Padding to apply around scale labels. Only `top` and `bottom` are implemented.
Expand Down
18 changes: 10 additions & 8 deletions docs/docs/getting-started/v3-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ A number of changes were made to the configuration options passed to the `Chart`
* `scales.[x/y]Axes.categoryPercentage` was moved to dataset option `categoryPercentage`
* `scales.[x/y]Axes.maxBarThickness` was moved to dataset option `maxBarThickness`
* `scales.[x/y]Axes.minBarLength` was moved to dataset option `minBarLength`
* `scales.[x/y]Axes.scaleLabel` was renamed to `scales[id].title`
* `scales.[x/y]Axes.scaleLabel.labelString` was renamed to `scales[id].title.text`
* `scales.[x/y]Axes.ticks.beginAtZero` was renamed to `scales[id].beginAtZero`
* `scales.[x/y]Axes.ticks.max` was renamed to `scales[id].max`
* `scales.[x/y]Axes.ticks.min` was renamed to `scales[id].min`
Expand Down Expand Up @@ -134,9 +136,9 @@ options: {
id: 'x',
type: 'time',
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Date'
text: 'Date'
},
ticks: {
major: {
Expand All @@ -155,9 +157,9 @@ options: {
yAxes: [{
id: 'y',
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'value'
text: 'value'
}
}]
}
Expand All @@ -172,9 +174,9 @@ options: {
x: {
type: 'time',
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Date'
text: 'Date'
},
ticks: {
major: {
Expand All @@ -192,9 +194,9 @@ options: {
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'value'
text: 'value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/advanced/line-gradient.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/animations/drop.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/animations/loop.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/charts/area/line-stacked.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@
},
scales: {
x: {
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
stacked: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/charts/line/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions samples/charts/line/interpolation-modes.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
},
suggestedMin: -10,
suggestedMax: 200
Expand Down
8 changes: 4 additions & 4 deletions samples/charts/line/line-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/charts/line/point-sizes.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/charts/line/skip-points.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
},
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/legend/callbacks.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/legend/point-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/legend/positioning.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/legend/title.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month'
text: 'Month'
}
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value'
text: 'Value'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions samples/scales/axes-labels.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
scales: {
x: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Month',
text: 'Month',
font: {
color: '#911',
family: 'Comic Sans MS',
Expand All @@ -95,9 +95,9 @@
},
y: {
display: true,
scaleLabel: {
title: {
display: true,
labelString: 'Value',
text: 'Value',
font: {
color: '#191',
family: 'Times',
Expand Down
4 changes: 2 additions & 2 deletions samples/scales/financial.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@
gridLines: {
drawBorder: false
},
scaleLabel: {
title: {
display: true,
labelString: 'Closing price ($)'
text: 'Closing price ($)'
}
}
},
Expand Down
Loading