[Chartjs]-Can't bind to 'chartType' since it isn't a known property of 'canvas' with angular12

6๐Ÿ‘

In your HTML template, you should replace [chartType]="barChartType" by [type]="barChartType".

For further information, please consult Chart types from ng2-charts documentation.

3๐Ÿ‘

We need to use "type" instead of "chartType".

The below code works

 <div style="display: block;">
        <canvas baseChart 
        [datasets]="barChartData"
        [labels]="barChartLabels"
        [options]="barChartOptions"
        [plugins]="barChartPlugins"
        [legend]="barChartLegend"
        **[type]**="barChartType">
      </canvas>
    </div>

details for the solution

Leave a comment