angular chart js doughnut colors

Solutions on MaxInterview for angular chart js doughnut colors by the best coders in the world

showing results for - "angular chart js doughnut colors"
Jan
25 Feb 2017
1// HTML
2div class="chart-wrapper">
3  <canvas baseChart [data]="doughnutChartData" [labels]="doughnutChartLabels" [colors]="colors"
4    [chartType]=" doughnutChartType">
5  </canvas>
6</div>
7
8// TS
9export class AppComponent {
10  doughnutChartLabels: Label[] = ['BMW', 'Ford', 'Tesla'];
11
12  doughnutChartData: MultiDataSet = [
13    [
14      55,
15      25,
16      20
17    ]
18  ];
19
20  doughnutChartType: ChartType = 'doughnut';
21
22  colors: Color[] = [
23    {
24      backgroundColor: [
25        'red',
26        'green',
27        'blue'
28      ]
29    }
30  ];
31
32}
33