const gainContext = this.gainRef.nativeElement.getContext('2d')
gainContext.canvas.height = '300px'
new Chart(gainContext, createChartConfig(gainConfig))
function createChartConfig({type, labels, data, label, color}: ChartConfig): ChartConfiguration<"line">{
console.log('3 Chart.defaults', Chart.defaults)
return {
type: "line",
data: {
labels,
datasets: [
{
label,
data,
borderColor: color,
stepped: false,
fill: false
}
]
}
}
This is not working: It not recognize the type property as it must in official documentation.
let myChart = new Chart(gainContext, { type: 'line',
What I do wrong?