You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get the basic area chart working on Stackblitz. I've installed ngx-echarts and imported the module. I've added the options to app.component.ts like this:
Type '{ xAxis: { type: string; boundaryGap: boolean; data: string[]; }; yAxis: { type: string; }; series: { data: number[]; type: string; areaStyle: {}; }[]; }' is not assignable to type 'EChartsOption'.
Types of property 'xAxis' are incompatible.
Type '{ type: string; boundaryGap: boolean; data: string[]; }' is not assignable to type 'XAXisOption | XAXisOption[]'.
Type '{ type: string; boundaryGap: boolean; data: string[]; }' is not assignable to type 'CategoryAxisBaseOption & { gridIndex?: number; gridId?: string; position?: CartesianAxisPosition; offset?: number; categorySortInfo?: OrdinalSortInfo; } & { ...; }'.
Type '{ type: string; boundaryGap: boolean; data: string[]; }' is not assignable to type 'CategoryAxisBaseOption'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"category"'.
Any ideas?
The text was updated successfully, but these errors were encountered:
Ok I figured it out. The options for the chart have to be set in ngOnInit otherwise the chart will not render. I'll leave the issue open since it's a little strange that it does not work the other way as well.
@fireflysemantics
Your option is initialized untyped, so compiler has to infer its type which seems incorrect. You can fix the issue by adding the EChartsOption:
Hi,
I'm trying to get the basic area chart working on Stackblitz. I've installed
ngx-echarts
and imported the module. I've added the options toapp.component.ts
like this:And declared the chart in
app.component.html
.And it produces this very long error:
Any ideas?
The text was updated successfully, but these errors were encountered: