Overview

The React Donut Chart is similar to a Pie Chart with a hole at the center. Compare how each data point contributes to the total through individual slices.


Custom inner radius

Customize radius and inner radius values to control the center space. Setting the inner radius to 0 converts the Donut Chart into a Pie Chart. Radius and inner radius values can be adjusted independently.


Donut legend

Legends display information about individual data points and their contribution to the total. Click a legend item to collapse or hide the corresponding point.


Start and end angle

Customize the start and end angle of the chart to achieve the semi-pie.


Data label

Data labels display information about data points. Templates support custom label content using HTML elements such as images, divs, and spans. Labels can also be rotated to a specified angle.


Smart labels

Arrange data labels automatically to prevent overlapping when data point values are closely spaced.


Grouped points

Group the points in Donut Chart based on some condition. The grouped slices can be split into individual points by clicking the slice.


Drill down operation

Focus in on the data within a slice using the drill down operation.


Donut with different radius

Customize the radius of individual slice using built-in APIs.


Donut Center

Move the center of the donut relative to the plot area.


Center label

Place a label at the center of the Donut Chart. Also, when the mouse pointer hovers over a donut slice, the relevant data is displayed at the center.


Customization

Customize the appearance of the Donut Chart through built-in APIs for flexible visual styling.


React Donut Chart code example

Get started with React Donut Chart using a few simple lines of HTML and JavaScript code example as demonstrated below. Also explore demo to learn how to render and configure the component.

<!DOCTYPE html>
<html>

<body> 
     <div id="charts"></div>
</body>

</html>
import { AccumulationChartComponent, AccumulationSeriesCollectionDirective, AccumulationSeriesDirective, Inject, PieSeries}
from'@syncfusion/ej2-react-charts';
import * as React from 'react';
class App extends React.Component<{}, {}> {
  public data1: any[]= [
    { x: 'United States', y: 45, text: 'USA', fill: '#00226C' },
    { x: 'Australia', y: 53, text: 'AUS: 14%', fill: '#0450C2' },
    { x: 'China', y: 56, text: 'CHN', fill: '#0073DC' },
    { x: 'India', y: 61, text: 'IND', fill: '#0D98FF' },
    { x: 'Japan', y: 40, text: 'JPN', fill: '#9CD9FF' },
    { x: 'United Kingdom', y: 20, text: 'UK', fill: '#0450C2' }
];

  public render() {
    return <AccumulationChartComponent id='charts'>
    <Inject services={[PieSeries]} />
    <AccumulationSeriesCollectionDirective>
      <AccumulationSeriesDirective dataSource={this.data1} xName='x' yName='y' type='Pie' innerRadius='40%'/>
    </AccumulationSeriesCollectionDirective>
  </AccumulationChartComponent>
  }
};
ReactDOM.render(
  <App />,
  document.getElementById('charts') as HTMLElement
);

Learning resources

UG

Donut Chart User Guide

Learn the available options to customize the React Donut Chart.

API

Donut Chart API Reference

Explore the React Donut Chart APIs.


Explore all Syncfusion React components

Explore over 140+ React UI components featuring established, and production-ready controls built for modern web app development.

Scroll up icon
Syncfusion Feedback