I'm upgrading Angular from 13 to 16, and after update I'm getting next error:
Error: some.component.ts:15:5 - error TS2322: Type '_DeepPartialObject<CoreChartOptions<"doughnut"> & ElementChartOptions<"doughnut"> & PluginChartOptions<"doughnut"> & DatasetChartOptions<"doughnut"> & ScaleChartOptions<...> & DoughnutControllerChartOptions> | undefined' is not assignable to type '_DeepPartialObject<CoreChartOptions & ElementChartOptions & PluginChartOptions<...> & DatasetChartOptions<...> & ScaleChartOptions<...>> | undefined'.
15 [options]="pieChartOptions">
Compiler highlights error at component template:
template: `
<canvas *ngIf="(pieChartData$ | async) as data" baseChart
[data]="data"
[type]="pieChartType"
[plugins]="pieChartPlugins"
[options]="pieChartOptions">
</canvas>
<div *ngIf="!(pieChartData$ | async)" class="no-data-placeholder">
{{ getNoDataPlacehoderText() }}
</div>
`,
Where piechart options and other chart data declared as:
export class RevenueDashboardCardPieChartComponent extends RevenueDashboardCardBaseComponent<ChartData<"doughnut">> {
@ViewChild(BaseChartDirective) chart: BaseChartDirective | undefined;
pieChartOptions: ChartConfiguration<"doughnut">["options"] = {
some options data
plugins: {
some options for plugins
}
};
pieChartType: ChartType = "doughnut";
pieChartData$: Observable<ChartData<"doughnut"> | undefined>;
pieChartPlugins = [ DataLabelsPlugin ];
}
Any ideas on what this error means an how to get it fixed? I had "similar" errors for FormControls, but it could be fixed by specifying generic type when creating control. Not sure how to fix it in pieChart case. Appreciate any help.
I had "similar" errors for FormControls, but it could be fixed by specifying generic type when creating control. Not sure how to fix it in pieChart case.