[Chartjs]-Type 'string' is not assignable to type 'ChartType'

5👍

Change your barChartType type from string to ChartType and import it from chart.js.

import { ChartOptions, ChartType, ChartDataSets } from 'chart.js';
public barChartType: ChartType = 'bar';

Demo: https://stackblitz.com/edit/ng2-charts-bar-template?file=src%2Fapp%2Fapp.component.ts

-1👍

Maybe if you change CharType datatype to any?

Leave a comment