[Chartjs]-Ng2-charts & chart.js โ€“ Change background color

8๐Ÿ‘

โœ…

Add the following property:

 private donutColors = [
    {
      backgroundColor: [
        '#ced',
        '#fda',
        '#fdd',
      ]
    }
  ];

Note that this is an array, not an object

Then, add the following property in the template

[colors]="donutColors"

Here is a Stackblitz demo

Leave a comment