I am trying to implement charts.js using mean stack, and when implementing the charts as recommended by the chart.js website, there is an error presented. When trying to implement the charts in the component.ts, i am getting the error:
Type 'Chart<"line", any, unknown>' is missing the following properties from type 'any[]': length, pop, push, concat, and 28 more.
33 this.chart = new Chart('canvas',{
and the error:
Type '{ display: true; }[]' is not assignable to type '_DeepPartialObject<{ type: "linear"; } & CartesianScaleOptions & { beginAtZero: boolean; suggestedMin?: number; suggestedMax?: number; grace?: string | number; ticks: { format: NumberFormatOptions; precision: number; stepSize: number; count: number; }; }> | _DeepPartialObject<...> | _DeepPartialObject<...> | _DeepPa...'. Type '{ display: true; }[]' is not assignable to type '_DeepPartialObject<{ type: "timeseries"; } & Omit<CartesianScaleOptions, "min" | "max"> & { min: string | number; max: string | number; suggestedMin: string | number; ... 4 more ...; ticks: { ...; }; }>'. Types of property 'reverse' are incompatible. Type '() => { display: true; }[]' is not assignable to type 'boolean'.
55 xAxes: [{
The component.ts:
this.chart = new Chart('canvas',{
type: 'line',
data: {
labels: areaCode,
datasets: [
{
data: inoperEqu,
borderColor: '#3cba9f',
fill: false
},
{
data: operEqu,
borderColor: '#ffcc00',
fill: false
},
]
},
options: {
legend: {
display: false
},
scales: {
xAxes: [{
display: true
}],
yAxes: [{
display: true
}]
}
}
})
})