mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 12:49:07 +02:00
c6976e8975
* New plugin: subtitle * Fix naive error for multiple charts
29 lines
802 B
Markdown
29 lines
802 B
Markdown
# Subtitle
|
|
|
|
Subtitle is a second title placed under the main title, by default. It has exactly the same configuration options with the main [title](./title.md).
|
|
|
|
## Subtitle Configuration
|
|
|
|
Namespace: `options.plugins.subtitle`. The global defaults for subtitle are configured in `Chart.defaults.plugins.subtitle`.
|
|
|
|
Excactly the same configuration options with [title](./title.md) are available for subtitle, the namespaces only differ.
|
|
|
|
## Example Usage
|
|
|
|
The example below would enable a title of 'Custom Chart Subtitle' on the chart that is created.
|
|
|
|
```javascript
|
|
var chart = new Chart(ctx, {
|
|
type: 'line',
|
|
data: data,
|
|
options: {
|
|
plugins: {
|
|
subtitle: {
|
|
display: true,
|
|
text: 'Custom Chart Subtitle'
|
|
}
|
|
}
|
|
}
|
|
});
|
|
```
|