Overview
Angular Donut Chart is like a Pie Chart, except for the space at the center. It is useful for when you want to compare the contribution of each data with the total.
Custom inner radius
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.
Doughnut Legend
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.
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. Add a template to display data labels with HTML elements such as images, DIV, and spans for more informative data labels. You can rotate a data label by its given angle.
Smart labels
Arranges data labels smartly to avoid overlapping when the data point values fall in close range.
Grouped points
Group the points in pie chart based on some condition. The grouped slices can be split into individual points by clicking the slice.
Drilldown Operation
Focus-in on the data within the data using drilldown operation.
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 of the donut chart.
Customization
Customize the look and feel of the doughnut using built-in APIs.
Angular Doughnut Chart Code Example
Easily get started with Angular Doughnut Chart using a few simple lines of HTML and TS code example as demonstrated below. Also explore our Angular Doughnut Chart Example that shows you how to render and configure the chart.
<ejs-accumulationchart id="chart-container">
<e-accumulation-series-collection>
<e-accumulation-series [dataSource]='data' innerRadius = "70%" xName='x' yName='y' type='Pie'></e-accumulation-series>
</e-accumulation-series-collection>
</ejs-accumulationchart>//app.component.ts
import { Component } from '@angular/core';
export class AppComponent {
public data: Object[] = [
{ x: 'JPN', text: 'Japan', y: 5156 },
{ x: 'DEU', text: 'Germany', y: 3754 },
{ x: 'FRA', text: 'France', y: 2809 },
{ x: 'GBR', text: 'UK', y: 2721 },
{ x: 'BRA', text: 'Brazil', y: 2472 },
{ x: 'RUS', text: 'Russia', y: 2231 },
{ x: 'ITA', text: 'Italy', y: 2131 },
{ x: 'IND', text: 'India', y: 1857 },
];
}
import { AccumulationChartModule } from '@syncfusion/ej2-ng-charts';
import { PieSeriesService} from '@syncfusion/ej2-ng-charts';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule, AccumulationChartModule
],
providers: [PieSeriesService],
bootstrap: [AppComponent]
})
export class AppModule { }
