Chart title and subtitle in JavaScript Chart component
18 Nov 20181 minute to read
Chart titles and subtitles help provide context for the visualized data. The title typically indicates the main subject or metric represented in the chart, while the subtitle adds supporting details such as data sources, time ranges, or explanatory notes. Both elements can be customized in terms of position, alignment, and style to align with application design requirements.
Chart title
Add a chart title using the title property. The title appears at the top of the chart by default and is used to describe the purpose or subject of the visualization.
Title position
Use the position property within titleStyle to place the title at the left, right, top, or bottom of the chart. The default position is at the top.
To manually position the title anywhere within the chart, use the x and y properties.
Title alignment
Align the chart title to the near, center, or far side of the chart using the textAlignment property.
Title wrap
Customize the title’s appearance using the textStyle property. Options include size, color, fontFamily, fontWeight, fontStyle, opacity, textAlignment, and textOverflow to control how the title is rendered within the chart area.