Like pie chart, except for the space at the center, this chart is also referred as doughnut chart. This chart is useful when you want to compare the contribution of each data with the total.
You can customize the inner radius of the chart to make it pleasing. Making inner radius to 0 will change the doughnut to pie chart. You can customize both the radius and inner radius of the doughnut.
Legends are used to show the information about each point to know about its contribution towards the total sum. You can collapse the point using legend click.
Customize the start and end angle of the chart to achieve the semi-pie.
Show the detail about the data points with the help of data label support. Can place the label inside and outside of the chart. Connector lines can be used to connect the outside label with charts.
Arranges data labels smartly to avoid overlapping when the data point values fall in close range.
Group the points in pie chart based on some condition. The grouped slices can be split into individual points by clicking the slice.
Focus-in on the data within the data using drilldown operation.
Customize the radius of individual slice using built-in APIs.
Move the center of the donut relative to the plot area.
Customize the look and feel of the doughnut using built-in APIs.
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'/>
</AccumulationSeriesCollectionDirective>
</AccumulationChartComponent>
}
};
ReactDOM.render(
<App />,
document.getElementById('charts') as HTMLElement
);
<!DOCTYPE html>
<html>
<body>
<div id="charts"></div>
</body>
</html>