React Chart - Title and Subtitle

Title and subtitle are textual elements that give an idea of what the Chart visualizes.

DevExtreme HTML5 JavaScript Charts Title Subtitle

The title is configured by the title object. The subtitle is configured by the subtitle object nested in the title object.

App.js
  • import React from 'react';
  • import Chart, {
  • Title,
  • Subtitle
  • } from 'devextreme-react/chart';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Chart ... >
  • <Title text="I am the Title">
  • <Subtitle text="I am the Subtitle" />
  • </Title>
  • </Chart>
  • );
  • }
  • }
  •  
  • export default App;

You can set the title's text more concisely by assigning it directly to the title property. This is useful if you are satisfied with the default settings of the title and do not need a subtitle.

App.js
  • import React from 'react';
  • import Chart from 'devextreme-react/chart';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Chart
  • title="I am the Title"
  • ...
  • >
  • </Chart>
  • );
  • }
  • }
  •  
  • export default App;

For information about all properties of the title and subtitle, visit the title section of the API reference.

See Also