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] type: 'line', using sampling = 'lttb'. None of the downmined points display the tooltip properly using showTip. #20488

Open gpcwhitecap opened 1 week ago

gpcwhitecap commented 1 week ago

Version

5.5.1

Link to Minimal Reproduction

https://codepen.io/gpcwhitecap/pen/abeQOyK

Steps to Reproduce

Enter the index of a sampled point in the input box and click Show Tooltip. The sampled point is not displayed properly.

Current Behavior

I plotted a rather complex big data line chart via echarts, and at the same time I took over the display of the tooltip manually (mousemove, calculate dataIndex). However, I found that the tooltip doesn't display when the dataIndex is a point that has been down-mined. For my needs, I just want the tooltip.formatter to be triggered properly, and I only need an index for the params passed by the formatter, because I'm completely taking over the content of the formatter (which is looked up by index). This problem causes the tooltip to be incomplete even when multiple charts are linked.

The function I'm using is chart.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: 100 });

I've taken a closer look at the source code, and it seems that the dataByCoordSys of the sampled points cannot be calculated

How can I solve this problem? Or how to avoid it?

Expected Behavior

showTip is able to show the downgraded tooltip instead of having to go through doomZoom.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

helgasoft commented 1 week ago

Isn't the purpose of lttb to exclude points ? Why expect that all points would be there ? Demo 📌 please close issue if problem solved.

gpcwhitecap commented 1 week ago

showTip

I can understand that the purpose of Lttb is to exclude points, assuming that there is a longer section of line that is all one value (30%), and when those points are excluded tooltip will not work properly in that section. This would be a disaster for business, at the moment I'm planning to completely rewrite tooltip by using mousemove, but it's a pain in the ass.

The actual business is that when 2 charts are linked, A tooltip's 20th point B's 20th point is excluded, and showTip can't display the excluded points. And my business thinks that if your charts are linked, why don't you show them below, they will be considered as missing points.

Yurunsoft commented 1 week ago

same problem!!!

helgasoft commented 1 week ago

Obviously we cannot display a tooltip for a non-existent point. But one could display a graphic.element content with any data.

Na-eng-web commented 3 days ago

same problem ! . is there any solution for this ?