Data representation with pie and doughnut charts

A pie chart (or a circle chart) is a circular statical graphic, which is divided into slices to illustrate the numerical proportion of composite data. The arch length of each slice is equal to the quantity of data entity. A basic example of the pie chart usage regarding the Prime libraries downloads would be as follows:

<p-chart #pie type="pie" [data]="piedata" width="300" height="100"></p-chart>

The component class should define the pie chart data with three slices for three prime libraries over the period of time, as shown here:

this.piedata = {  labels: ['PrimeNG', 'PrimeUI', 'PrimeReact'],  datasets: [    {      data: [3000, 1000, 2000],      backgroundColor: [        "#6544a9",        "#51cc00",        "#5d4361"      ],      

Get Angular UI Development with PrimeNG now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.