7π
β
In my opinion, there is an option to do that by the colors
property.
Just pass an array of colors objects (refer here to see the object)
Add the input in the HTML like that:
<div style="display: block;">
<canvas baseChart
[datasets]="barChartData"
[labels]="barChartLabels"
[options]="barChartOptions"
[plugins]="barChartPlugins"
[legend]="barChartLegend"
[chartType]="barChartType"
[colors]="colors">//<---------------the colors input property
</canvas>
</div>
Then just add in your ts file the next object:
public colors = [
{ backgroundColor:"red" },
{ backgroundColor:"green" },
{ backgroundColor:"blue" },
{ backgroundColor:"yellow" }
];
Source:stackexchange.com