Here is the clear view of the error: Can someone help me resolve it?
Type '{ legend: { position: string; }; title: { display: true; text: string; }; }' is not assignable to type '_DeepPartialObject<CoreChartOptions<"bar"> & ElementChartOptions<"bar"> & PluginChartOptions<"bar"> & DatasetChartOptions<"bar"> & ScaleChartOptions<...> & BarControllerChartOptions>'. Object literal may only specify known properties, and 'legend' does not exist in type '_DeepPartialObject<CoreChartOptions<"bar"> & ElementChartOptions<"bar"> & PluginChartOptions<"bar"> & DatasetChartOptions<"bar"> & ScaleChartOptions<...> & BarControllerChartOptions>'.ts(2322) index.esm.d.ts(3599, 3): The expected type comes from property 'options' which is declared here on type 'ChartConfiguration<"bar", any, unknown>'
Here I have attached my code in my component.ts.
new Chart('myChart',{
type: 'bar',
data :{
labels: this.team,
datasets: [
{
data: this.totalDefects,
borderColor : '#000000',
backgroundColor : '#8e5ea2',
label : "Total defect count",
}
]
},
options: {
legend: {
position : 'top',
},
title:{
display: true,
text : 'Total number of defects raised by each team across iterations'
}
}
});
<canvas id="myChart" style="width:100%;max-width:600px"></canvas>