apache / echarts

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

[Bug] Stale renders on data zoom slider change #18398

Open nikeshparajuli opened 1 year ago

nikeshparajuli commented 1 year ago

Version

5.4.1

Link to Minimal Reproduction

No response

Steps to Reproduce

  1. Drag data zoom slider all the way to the left from right CleanShot 2023-03-17 at 05 44 27

  2. Drag data zoom slider to the right to expand selection CleanShot 2023-03-17 at 05 43 58

  3. Drag back and forth again to see multiple stale rendering

Current Behavior

Creates multiple stale renders

Expected Behavior

Should render only once after data zoom

Environment

- OS: macOS
- Browser: Google Chrome
- Framework: Vue 3

Any additional comments?

All are same curve but rendered multiple times (some go away on hover): CleanShot 2023-03-17 at 05 38 04

Just curious if anyone has come across this? The steps I used for recreating are for smaller data sets. For larger data sets, you don't have to drag all the way to the left to see this. It happens as soon as you drag the x-axis slider to any position.

Ovilia commented 1 year ago

Please provide a demo for the issue either with Official Editor, CodePen, CodeSandbox or JSFiddle.

DanielZellner commented 8 months ago

I have the same issue, but it only happens on larger datasets in my case (over 20.000 - 30.000 datapoints) It seems like there is a problem with the loading/rendering of the chart after dragging around the slider, setting realtime: false datazoom.slider.realtime slightly improves this behavior, but when the dataset gets bigger the issue still persist.

Version/Enviroment:

Steps to reproduce:

Or:

DanielZellner commented 8 months ago

when the renderer is svg, the issue is gone, but the chart gets so slow that it is not usable anymore

nikeshparajuli commented 8 months ago

@DanielZellner I couldn't get around this issue with the xAxis type being set to category (which is what I had initially). So I changed the xAxis to be of type value and I don't have these issues anymore. The data structure we provide to the series data will now be a 2D array (number[][]) instead of just a single dimensional array (number[]). I've only gone as far as ~10k data points and it seems to be ok handling that. No annoying stale renders.

DanielZellner commented 8 months ago

@nikeshparajuli thank you for your response, but the things you mentioned have I already tried or is already built in. My issue is that my data can go up to 80.000 to 100.000 data points, depending on the date range. Up to 10.000 data points, I also do not get this issue, but as more data loads in as more stale renders are happening. Is there maybe a configuration that could help with this issue, besides using svg as renderer, @Ovilia? All animations are already in my code disabled, realtime is to false as well, I tried throttle, but it did not make any difference, svg is also not helping, because my memory usage goes up to 500mb and everytime you slide around the slider, echarts needs 10 seconds or more to load the data again.

Maybe something to mention is that I use a 2D chart, but like in my first response, my array has for each entry 4 values, so when I talk about 80.000 to 100.000 data points, those are actually 320.000 - 400.000, well I know that it makes it not better

DanielZellner commented 4 months ago

@Ovilia I checked the issue again, since there was a new echarts update. Issue is still not resolved.