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

[Bug] Line chart is not animated when passing it by updating [options] #353

Open Deohgu opened 2 years ago

Deohgu commented 2 years ago

Echarts version: 5.2.2 ngx-echarts version: 6.0.1


  1. Init the chart 1.1. Call chartInstance.setOption with 1 graph in series 1.2 [options] receives new data
  2. Chart renders graph 1 with animation
  3. Short delay 3.1. Call chartInstance.setOption with 2 graphs in series with the first being the same data as before and the second being a new line graph 3.2 [options] receives new data
  4. First graph is not re-rendered, second line graph renders on top of the first one but without an animation.

{
  data: lineXY,
  animation: true,
  animationDuration: 5000,
},

I've set the style to style="height: 100%;" in the element as #102 recommends, but that does not fix it.

daniel-bunny-net commented 2 years ago

Hi, I presume series data has a specified attribute 'name' or 'id', so that echart can merge correctly data series together?

MeMeMax commented 2 years ago

I experience this issue for all chart types. I can´t set a fixed height since the charts are in a dynamic container. Would be great if you could make animations work with your wrapper.