apache / echarts

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

[Bug] tooltip.axisPointer.snap:true not working well with sampling: 'lttb' #18129

Open jeandet opened 1 year ago

jeandet commented 1 year ago

Version

5.4.1

Link to Minimal Reproduction

https://github.com/jeandet/JS_experiments/blob/2e81d1179781fa30f569fd818d0276d21a9b3def/eCharts/index.html

Steps to Reproduce

Just load the html file and compare tooltip while zoomed or not. Then replace sampling by 'max' for example and repeat.

Current Behavior

When zoomed out tooltip doesn't always show all series values while they have the exact same sampling time, this seems to be due to lttb resampling algorithm. Not sure why it doesn't preserve the same time for each pixel, assuming it only downsample to ~2 values per pixel.

Expected Behavior

Using lttb resampling algorithm shouldn't affect resulting points time and so tooltip should show values for all series when they share the same source sampling rate/time.

Environment

- OS:Linux
- Browser:Brave
- Framework:

Any additional comments?

The given example fetches data from a public WS.

VinskyStrauss commented 4 months ago

I have a problem with the snapping. I have a charts that contains quite a lot of data and the AxisPointer will be left behind if I move my cursor quite fast. is there any solution for it?