apache / echarts

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

[Bug] 桑基图点击edge时,对应的tooltip formatter函数中的数据不正确 #17945

Open xyhxyw opened 1 year ago

xyhxyw commented 1 year ago

Version

5.4.0

Link to Minimal Reproduction

https://codepen.io/xyhxyw/pen/jOKYXOz

Steps to Reproduce

1、监听echart的click事件,打印args参数; 2、单击桑基图的edge,通过dispatchAction方法显示tooltip; 3、在tooltip的formatter函数中,打印params参数; 4、click事件中显示当前dataType为edge,但是tooltip的formatter函数中显示为node。且该函数中的数据并不是点击edge的数据。

Current Behavior

1、tooltip的formatter中,打印数据并非当前点击的edge数据。

Expected Behavior

1、tooltip的formatter中正确显示当前点击的edge数据。

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

echarts-bot[bot] commented 1 year ago

@xyhxyw It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** [Bug] When the edge is clicked on the Sankey diagram, the data in the corresponding tooltip formatter function is incorrect **BODY** ### Version 5.4.0 ### Link to Minimal Reproduction https://codepen.io/xyhxyw/pen/jOKYXOz ### Steps to Reproduce 1. Listen to the click event of echart and print the args parameter; 2. Click the edge of the Sankey diagram, and display the tooltip through the dispatchAction method; 3. In the formatter function of the tooltip, print the params parameter; 4. The current dataType is displayed as edge in the click event, but it is displayed as node in the formatter function of the tooltip. And the data in this function is not the data of clicking edge. ### Current Behavior 1. In the formatter of the tooltip, the print data is not the currently clicked edge data. ### Expected Behavior 1. The currently clicked edge data is correctly displayed in the formatter of the tooltip. ### Environment ```markdown - OS: -Browser: - Framework: ``` ### Any additional comments? _No response_