Trying to type the options as EChartsOption instead of any in this stackblitz demo.
And if the switch is made like this:
options!: EChartsOption;
//options!: any;
Then the linting creates this error:
Type '{ normal: { color: string; }; emphasis: { color: string; borderColor: string; borderWidth: number; }; }' is not assignable to type 'ItemStyleOption<CallbackDataParams>'.
Object literal may only specify known properties, and 'normal' does not exist in type 'ItemStyleOption<CallbackDataParams>'.
And I'm trying to figure out whether the chart configuration is wrong or the EChartsOption type is not complete.
When the type is set to any, the chart renders fine, and it does support the normal declaration as defined:
normal: {
color: 'rgba(0,0,0,0.3)',
},
Looking at the ECharts documentation I don't see itemStyle listed under series.
However it does work ...
Thoughts?
itemStyleis listed underseries:{type: 'line', ...}, [docs link]. (Not very relevant, but I see you linked to echarts docs for v4 but your stackblitz is using the latest v5.)However,
itemStyledoesn't have neither anormalnor anemphasissubcategory. The emphasis itemStyle is underemphasis.itemStyle[docs link]So, the itemStyle options should be structured like this: