Customizing React Chart Appearance

You can enhance the overall look and feel of a chart by configuring the following properties in the Chart component:

  • background: Sets the chart’s background using a solid color or an image.
  • border: Defines the border’s color, width, and style to visually frame the chart.
  • margin: Controls the spacing around the chart, helping with layout and positioning.
Loading...

Chart area

The chart area refers to the region where data is plotted, excluding elements such as titles, legends, and axes. You can customize this area using the ChartArea component by adjusting the following properties:

  • background: Sets the background color or image behind the plotted data.
  • border: Defines the outline around the chart area for better visual separation.
  • margin: Manages internal spacing within the chart layout to ensure proper alignment and clarity.
Loading...

Chart title

To display a title on the chart, use the text property within the ChartTitle component.

You can customize the title’s appearance using the following properties:

  • fontSize – Sets the font size of the title text.
  • background – Defines the background color behind the title.
  • color – Specifies the color of the title text.
  • position – Determines the placement of the title (e.g., top, bottom).
  • align – Aligns the title text (e.g., center, left).
  • border – Adds a border around the title for visual emphasis.
Loading...

Chart subtitle

Use the text property in the ChartSubtitle component to display a subtitle below the main chart title.

You can customize the subtitle’s appearance using the following properties:

  • fontSize – Sets the font size of the subtitle.
  • background – Defines the background color.
  • color – Specifies the text color.
  • position – Determines the placement relative to the chart.
  • align – Aligns the subtitle text (e.g., left, center).
  • border – Adds a border around the subtitle for visual emphasis
Loading...

Chart dimension

Chart dimensions can be defined using fixed pixel values or percentages for precise sizing. They can also be adjusted relative to the parent container for a responsive layout, allowing the chart to adapt to different screen sizes and layouts

Size for container

The chart can automatically adjust to fit its container. Set the size using inline styles or CSS classes:

Loading...

Size for chart

To set a specific size directly on the chart, use the height and width properties in the ChartComponent. These can be defined in pixels or percentages

Loading...

Custom color palette

The default colors of chart series or data points can be customized by providing a custom color palette using the palettes property.

Loading...