[Chartjs]-NgChartsModule: The data for bar graph is not showing

1👍

Just change the following things. In the reports.compononent.ts uncomment the labels and use

public barChartLabels: string[] = ['2006', '2007', '2008', '2009', '2010', '2011', '2012'];

then in the html add the labels like so

<canvas baseChart 
                  [datasets]="barChartData"
                  [labels]="barChartLabels"
                  [options]="barChartOptions"
                  [plugins]="barChartPlugins"
                  [legend]="barChartLegend"
                  [type]="'bar'">
                </canvas>

I think the library needs the labels and data to work properly. With this I got the following picture
Result

Leave a comment