xieziyu / ngx-echarts

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

Gauge type series can not use "merge" input #373

Closed sneaker102 closed 5 months ago

sneaker102 commented 1 year ago

Hi,

I am building a gauge chart that looks like this: image

Before implementing the chart in your lib I was creating the options inside echarts example playgraund. These are the options: gouge-thresholds.txt

The issue that I have with your lib is that I can not use the "merge" input of your directive as I did into the playground with the "setInterval" function.

When I provide into the "merge" the data series like this: image This errros will appear: image image

Having this errors the graph will never refresh again.

If the "merge" is undefined than no errors will be thrown but I will get a flickering on the axis labels at init.

Maybe I am doing something wrong and I would like to hear your opinion on this.

Thanks for your work, Razvan I.

xieziyu commented 1 year ago

merge is used to update options after the chart is initialized. So you can try to provide merge object after delaying for some time, for example, assign merge within setTimeout or setInterval callbacks

sneaker102 commented 1 year ago

Thanks for the fast response but I've tried to delay the merge object and I still have the same errors. I have also to mention that for line and bar charts it works as expected.

xieziyu commented 1 year ago

Hi, @sneaker102 I create a demo using your chart options: https://jake.stackblitz.com/edit/ngx-echarts-issue-373?file=src/app/app.component.ts but it works as expected. Maybe you can provide more details about your codes that I need to reproduce the issue.