apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.69k stars 19.62k forks source link

[Bug] float point number data chart animation #19809

Open johnny-mh opened 7 months ago

johnny-mh commented 7 months ago

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=line-gradient&version=5.5.0&code=PTAEAcCcFMBdYJbUgWgQcwHYHsYCgA3AQ0lABMjYiBGUAXlAG09RWmW3OAiAJgAYeAFhR9hfAJwAVatQBcAVgAcsnjwB0fTQC0uAGg6dWfDZvEA2aosHUAzPLM2-1eT3HyDoALr7OzQ214BMTEpGQVlG3VNPh0ff1BjTWpBUQseAHYlHnlBdLSPbw8_eMChERDpOSVZQSjtPQ9ORKdbM0VqcR5FeXTknjN3TkLfRoD-MtERUKrlFxMYhviEk2SbdOseZ0ibM0ErHgK41mL_UuCpyoVxWQF52NGjFcE1ja2eHb3aw6KH0DPyi5heTXah1BZHQzNah8KzidI2SJdNZrQZsYZsE6Gf6TCSXYEqMH3JZQzQOBHUBz2bp8NbfEZLbEVIHXSJ3RbxEl8Mk2Cl2NryGnpOkY36MwFVa61NkQporaHAxy9PjyHbrd7C46i8bnXHMhSE9n-KGKcyZdK9eQCjqWg5DCGY7jagG6ng3Pg3A0ytjG009C1WtwuDXsBlOnGhV2aWSg6W_Zp8eFmTo9AXvfgCxTBh1jILOiNugmx4krbrvdJdLlJzSqcRZrW58PSSPu1nRIkcksuNYVsxVgSuOuhhtM5s1T1x-biQTiNyddLiGE2cyRQclMMjgtzNuGyGT6ezjILxRLhy2tH2-sTDdOD1FjvRKcz4GHxfLs-sdGaodXwGRuQx7cvUeJJLD2GlHzcJwBTMVdTnXX8bjkVQ7yNOUrEUcD9ytaDYKxeCXUQ2RW3qIDliSE9j15Z5QTcZJcMdYcEJvKVAIncjzEohxqNceQ6LtH5vx1fMby3Ei2KcTYdneGFknnRRFE2eicx_AiBFvVjiySAQTynWEVXeXIlNYMVVNdACxM0pxtPMXTp30mxDP4-k10Y0zCw0-8rPeGzPjcbZHPPASXJU4TXWI8FxNBRNXAXZ4lxSTMnJFQS8ybD0xxQ3ckgyKSZ1EBEpxhIy_nw0L9Uy2VsuivK4sKxLAucuDXOEmx1IszzQRpd4zGVNpnA6cRqGKkyWujcdLM67YeqpfqZyGpKv2CoS0ppdz2tQ7Kup2Xr2l4uaCjwTw8DwAAbOByEoIgeHoC6qGoNQAFsiHAAAKF7GEQB7oF0UBiBOgBXaBPAASnoAA-JhPu-0AAFlKAACzUABjaAEBOl6_sB0AACpQGhaJgZBgBuY6AGc4EkBAvuwf7YDe0G6AhgBvDgHoATwAYXhkhYDUcnYAAeXARBsEwF6Wc4cnICQUnZCYJnbqIOWKDu0AAF8foVlWlcV661aO1g1eBkmNbxgmSbwbBhYQUWbol0BEFgM65cxe3ODOgAzWA5YAchRzBYGQH2vUDgAPb3QB9j2TuwShQFJp6TpO36iAB6BSZ9jwNY8N22FgK3fctABSYPRk9iO_egAOg5D6Bw99hBq_QZAU7TjOs44dF8-wE7EHAOWFdgaX0GbyBfaIUOEAz9W4lDgBBSfZflh22fAaBfahn2Z9AQfV_XyPN5-9BpbIABJTAyDruXaH1uI2YXqeXaZ02FePhAz4vq-8fV9E37IJ_QAACNsDwGwA9X2PUS7b0HgXSOkCt63w4FLGWLsc6jFgHvX2J1G7QFLv4bWqCliMB9qVPEyhkJtmDpHFAPtPyGGIaQ0ENxWoUO0FQn2NCDaGC4YbCEudWAYLXlgnBeDDAEJDPEBhzUyFrRiOwzhpEpEhRWiwwk8jaGjDoaweei9z6X1DtfL099dGfwMXjDuH48BqyJkAA

Steps to Reproduce

  1. Click on the Link to Minimal Reproduction link.
  2. After 1 second, you can observe that the animation is only applied to the first chart.

Current Behavior

Only the first chart displays animation. Notably, the first and second data points in the chart are not animated.

Expected Behavior

Animation should play smoothly on all charts. The animation should be applied to all data points within each chart.

Environment

- OS: macOS Monterey
- Browser: 123.0.6312.107
- Framework: vanilla echarts

Any additional comments?

No response

helgasoft commented 7 months ago

confirmed - no second series animation

Jmelon66 commented 7 months ago

you may be need to use chart.clear() before setOption such as setTimeout(() => { myChart.clear() option.series[0].data=data1 option.series[1].data=data2 myChart.setOption(option); }, 1000);

johnny-mh commented 7 months ago

you may be need to use chart.clear() before setOption such as setTimeout(() => { myChart.clear() option.series[0].data=data1 option.series[1].data=data2 myChart.setOption(option); }, 1000);

While this method seems to work fine in the provided demo, I've observed an unusual behavior in my testing. The animation initially functions correctly upon the first update. However, upon performing a second update, the data points disappear temporarily and then reappear.

If polling is being performed, it seems like it will continue to flicker. Implementing a flag to restrict execution to the first instance is feasible, but I view it as a short-term fix.