Chartjs-Colors not showing up on charts in ionic 3

0👍

Hello, use [colors]=”chartColors” in canvas

home.html

<div style="display: block;">
<canvas baseChart [data]='donutChartData' height="350" [labels]='donutChartLabels' [colors]="chartColors" [chartType]='donutChartType'>
</canvas>

in home.ts create variable;

  public chartColors: any[] = [
    {
      backgroundColor:["#FF7360", "#6FC8CE", "#8dd35f", "#2a80f7"]
    }];

Leave a comment