Click here to Skip to main content
15,883,843 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i tried the below code,but its not working,have to place the text content inside doughnut

What I have tried:

<p-chart
 type="doughnut" 
 [data]="data" [options]="doughnutOptions">

this.data = {
              labels: ['a', 'b', 'c', 'd', 'e'],
              datasets: [
                {
                  data: [],
                  backgroundColor: [
                    'green',
                    '#51087E',
                    '#ffd740',
                    'red',
                    '#5500FF',
                  ],
                },
              ],
            };

            this.doughnutOptions = {
              responsive: true,
              plugins: {
                legend: {
                  position: 'right',
                  labels: {
                    boxWidth: 17,
                    boxHeight: 15,
                    color: '#000000',
                  },
                },
              },
            };
Posted
Updated 5-Sep-22 3:57am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900