Title
About
A Title object defines how a title is included in a chart. Set the text property to a non-empty string to add the title. Leave the property empty to omit it. A title can be added on top of a chart or along an axis.
Properties
The following properties can be set:
Property | Definition | Type | Default |
---|---|---|---|
text | The title's text | String | '' |
style | The text's style | TextStyle | { color: 'black', fontSize: 10, fontWeight: 'normal', fontFamily: 'system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif"'} |
Example
In this example, we give the chart and both axes a title. The chart's title is customized. Titles of the axes are left with their default style.
//chart title
chart.layout.title = {
text: 'Chart Title',
style: {
fontSize: 16,
fontWeight: 'bold',
fontFamily: 'Georgia, serif'
}
};
//X-axis title
chart.layout.xAxis.title.text = 'X-axis Title';
//Y-axis title
chart.layout.yAxis.title.text = 'Y-axis Title';
Comments
Contents