Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line chart 的 event 交互無法明確取得 data element #44

Closed
Jazznight opened this issue Dec 1, 2016 · 2 comments
Closed

line chart 的 event 交互無法明確取得 data element #44

Jazznight opened this issue Dec 1, 2016 · 2 comments

Comments

@Jazznight
Copy link

line 的 Geom 在 event的交互我遇到了以下問題:

  1. plotclick事件是整個canvs的事件,如果data set有多個group/line,沒有明確點到data point會取不到data。

建議:因為多group的情境實際上每個event觸發點會有多個資料點(y),那是否能只回傳x軸的值?

@dxq613
Copy link
Member

dxq613 commented Dec 2, 2016

是的,现在的情况确实是点、柱子、多边形返回的是具体的文本,如果是线、区域图的时候,返回的数据是线整体的数据,建议这时候通过另外一个计算tooltip的方法来获取当前的信息,如果有多条线的话也会显示多条数据值

chart.getTooltipItems({x: ev.x, y: ev.y});

https://g2.alipay.com/api/#getTooltipItems

@Jazznight
Copy link
Author

@dxq613 這招好!

g2真的很棒,期待每個新版!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants