Angular PrimeNG DoughnutChart Component Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the DoughnutChart Component in Angular PrimeNG A Doughnut chart is a variant of the pie chart, with a blank center allowing for additional information about the data as a whole to be included. Syntax: <p-chart type="doughnut" [data]="data" [options]="chartOptions" > </p-chart> Creating Angular application & Module Installation: Step 1: Create an Angular application using the following command. ng new appnameStep 2: After creating your project folder i.e. appname, move to it using the following command. cd appnameStep 3: Install PrimeNG in your given directory. npm install primeng --save npm install primeicons --save npm install chart.js --saveProject Structure: It will look like the following: Example 1: This example describes the DoughnutChart Component in Angular PrimeNG. app.component.html HTML <div id="GFG"> <h1 style="color:green">GeeksforGeeks</h1> <h2>Angular PrimeNG Doughnut Chart </h2> <div style="width:30%;"> <p-chart type="doughnut" [data]="data" [options]="chartOptions"> </p-chart> </div> </div> app.component.ts JavaScript import { Component } from "@angular/core"; @Component({ selector: "app-root", templateUrl: "./app.component.html", styleUrls: ["./app.component.css"], }) export class AppComponent { title = "GFG"; data = { labels: ["A", "B", "C"], datasets: [ { data: [150, 50, 100], backgroundColor: ["#FF6384", "#36A2EB", "#FFCE56"], }, ], }; chartOptions = { plugins: { legend: { labels: { color: "#495057", }, }, }, }; } app.module.ts JavaScript import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { ChartModule } from 'primeng/chart'; @NgModule({ declarations: [ AppComponent, ], imports: [ BrowserModule, ChartModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } Output: Example 2: This example describes the DoughnutChart Component in Angular PrimeNG, where we will be creating hover options in Doughnut, and also adding more datasets. app.component.html HTML <div id="GFG"> <h1 style="color:green">GeeksforGeeks</h1> <h2>Angular PrimeNG Doughnut Chart </h2> <div style="width:30%;"> <p-chart type="doughnut" [data]="data" [options]="chartOptions"> </p-chart> </div> </div> app.component.ts JavaScript import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', }) export class AppComponent { title = 'GFG'; data = { labels: ['A', 'B', 'C', 'D'], datasets: [ { data: [200, 150, 50, 100], backgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56", "green" ], hoverBackgroundColor: [ "#FF6384", "#36A2EB", "#FFCE56", "lightgreen" ] } ] }; chartOptions = { plugins: { legend: { labels: { color: '#495057' } } } }; } app.module.ts JavaScript import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { ChartModule } from 'primeng/chart'; @NgModule({ declarations: [ AppComponent, ], imports: [ BrowserModule, ChartModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } Output: Reference: http://primefaces.org/primeng/chart/doughnut Comment More infoAdvertise with us Next Article Angular PrimeNG Line Chart Component A abhiisaxena09 Follow Improve Article Tags : Technical Scripter Web Technologies AngularJS Technical Scripter 2022 Similar Reads ChartModel ComponentAngular PrimeNG ChartModel ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 5 min read Angular PrimeNG ChartModel Change DetectionAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 4 min read Angular PrimeNG ChartModel PropertiesAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 4 min read Angular PrimeNG ChartModel Chart TypesAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 4 min read Angular PrimeNG ChartModel EventsAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 4 min read Angular PrimeNG ChartModel ResponsiveAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 4 min read BarChart ComponentAngular PrimeNG BarChart ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see how to use the BarChart Component in Angular PrimeNG. A Bar Chart or ba 4 min read Angular PrimeNG BarChart VerticalAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the Bar Chart Vertical in Angular PrimeNG. A Bar Chart or bar graph is 3 min read Angular PrimeNG BarChart HorizontalAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. A bar chart or bar graph is a chart that presents Grouped data with rectangular bars with lengths pr 3 min read Angular PrimeNG BarChart Multi AxisAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the BarChart Multi Axis in the Angular PrimeNG A Bar Chart or bar graph 4 min read Angular PrimeNG BarChart StackedAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will learn about Bar Chart Stacked in Angular PrimeNG. A bar chart or bar graph 4 min read Doughnut Chart ComponentAngular PrimeNG DoughnutChart ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the DoughnutChart Component in Angular PrimeNG A Doughnut chart is a va 3 min read Line Chart ComponentAngular PrimeNG Line Chart ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 4 min read Angular PrimeNG Line Chart Multi AxisAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. A line chart or line graph is a type of chart that displays information as a series of data points c 4 min read Angular PrimeNG Line Chart Line StylesAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the Line Chart Line Styles in Angular PrimeNG. A line chart or line gra 3 min read Polar Area Chart ComponentAngular PrimeNG Polar Area Chart ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the Polar Area Chart Component in Angular PrimeNG. Polar area charts ar 3 min read Pie Chart ComponentAngular PrimeNG Pie Chart ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the Pie Chart Component in Angular PrimeNG.A Pie Chart is a circular st 3 min read Radar Chart ComponentAngular PrimeNG Radar Chart ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the Radar Chart Component in Angular PrimeNG. A Radar Chart is a graphi 3 min read Combo Chart ComponentAngular PrimeNG Combo Chart ComponentAngular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will see the Angular PrimeNG Combo Chart Component. The Combo Chart Component pr 3 min read Like