xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

"echarts"' has no exported member named 'EChartOption'. Did you mean 'EChartsOption' instead? #294

Closed jayudhandha closed 3 years ago

jayudhandha commented 3 years ago

Hi,

I am using Angular 9 along with "ngx-echarts": "5.2.2" and "echarts": "5.0.0".

Everything works fine accept while setting icon: 'circle' for legends. It says below thing.

Type '{ icon: string; top: string; left: string; orient: "vertical"; }' is not assignable to type 'LegendOption | ScrollableLegendOption | (LegendOption | ScrollableLegendOption)[]'.

As per example in ngx-echarts I can't use import { EChartOption } from 'echarts';

I have checked that icon is available in EchartOption instead of Echart**s**Option

Is there anything i am missing?

After installing @types/echarts my code is working and showing legend with circle icon but have random error that it can't find EchartOption in echarts (My angular is not taking care of this and running application by ignoring this error)

RIght now i went with import { EChartsOption } from 'echarts'; and removed @types/echarts library. And i can't change legend icon for the moment :( Any help?

Thanks, Jayesh

t3rmo commented 3 years ago

Same issue here. I even went a step further and updated ngx-echarts to version 6.0.0 and echarts to version 5.0.2. To me it feels like we have to wait for a update of the ngx-charts library.

tmtron commented 3 years ago

When yo use echarts 5 you MUST NOT install @types/echarts, because echarts 5 is now written in typescript: i.e. the echarts package already includes the correct types for this version.

There have been many changes between echarts 4 and echarts5 - one of them is that EchartOption is now called EchartsOption (with plural "s")

jayudhandha commented 3 years ago

@tmtron thanks for the insight. Can you help me to find a way to change legends to circle in echarts 5?

tmtron commented 3 years ago

legend.icon?

But this is not related to ngx-echarts - so better ask on Stackoverflow and use the echarts tag.

jayudhandha commented 3 years ago

If anyone come here and wants to answer, please visit below link.

StackOverflow