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

echarts中实现多个tooltip存在 #11382

Open
joinwen opened this issue Oct 11, 2019 · 25 comments
Open

echarts中实现多个tooltip存在 #11382

joinwen opened this issue Oct 11, 2019 · 25 comments
Labels
discussion-required Further discussion is required before we decide if this issue should be fixed. new-feature priority: high topic: tooltip
Milestone

Comments

@joinwen
Copy link

joinwen commented Oct 11, 2019

echarts,能够实现
1.多个tooltip共存吗
2.通过点击事件增加或者减少tooltip

@Ovilia
Copy link
Contributor

Ovilia commented Oct 12, 2019

目前不支持,之前也有人提出这个需求。需要讨论下是不是要做这个功能,如果做的话,应该会进 5.0 的大版本需求。

@Ovilia Ovilia added topic: tooltip new-feature discussion-required Further discussion is required before we decide if this issue should be fixed. labels Oct 12, 2019
@Ovilia Ovilia added this to the 5.0.0 milestone Oct 12, 2019
@Ovilia
Copy link
Contributor

Ovilia commented Oct 15, 2019

@joinwen 请提供一下具体的需求,为什么需要多个 tooltip,使用场景如何,期望的 option 是什么样的?

@joinwen
Copy link
Author

joinwen commented Oct 16, 2019

类似这种,image

@pissang
Copy link
Contributor

pissang commented Oct 17, 2019

这个有点脱离了我们对 tooltip 的定义了(单例,不能一直存在),现在有个长期存在的配置主要是为了移动端的交互

可以试下外部扩展这个组件,这些 UI 通过 dom 来画,然后使用 https://echarts.apache.org/zh/api.html#echartsInstance.convertToPixelhttps://echarts.apache.org/zh/api.html#echartsInstance.convertFromPixel 来得到相应的坐标和数据

@Ovilia
Copy link
Contributor

Ovilia commented Oct 18, 2019

我觉得 tooltip 的定义并不包括「单例」,tooltip 应该是用来可交互式地展现数据细节的组件,如果用户能提供合理的多 tooltip 场景,还是值得讨论的。
鉴于很多人有这样的需求,能提供一种方便的 tooltip 或其他组件实现类似的效果是有很大价值的。

@cr-ruirui
Copy link

不太清楚啊,产品要做的

@Ovilia
Copy link
Contributor

Ovilia commented Oct 18, 2019

@cr-ruirui 那么问一下产品这样设计的目的是什么,效果图是怎么样的?

@cr-ruirui
Copy link

image
这是效果图

@Ovilia
Copy link
Contributor

Ovilia commented Oct 18, 2019

怎么这么像……所以你和 @joinwen 是同事?
这个图有 tooltip 吗?
感觉这个增减光标的确实跟 tooltip 关系有点远,不是那么通用,还是需要那么自己去实现。

@cr-ruirui
Copy link

不会啊,请问下怎么实现呢

@Ovilia
Copy link
Contributor

Ovilia commented Oct 18, 2019

#11382 (comment)

@vvkee
Copy link

vvkee commented Dec 3, 2019

@Ovilia 多坐标系,hover的时候不同坐标系上的线图或者柱状图显示对应的tooltip。这是产品的需求。
目前有没有办法在不同图层,设置不同的tooltip。
例如:1,2,3图层。1号图层是柱状图,2号图层是线图,3号图层是散点图。他们的x轴的数值一样。当hover到其中一个图上的时候,显示这3个图层对应x轴上的tooltip。
不知道目前是否支持

@sophia1024
Copy link

image
一个图,两个数据表图,希望每个数据表图都要tooltip,并且hover的时候,两个tooltip联动,要如何实现呢?

@susiwen8
Copy link
Contributor

image
一个图,两个数据表图,希望每个数据表图都要tooltip,并且hover的时候,两个tooltip联动,要如何实现呢?

@sophia1024 试试 connect?
https://echarts.apache.org/zh/api.html#echarts.connect

@rascaler
Copy link

rascaler commented May 3, 2021

@Ovilia
@pissang
我想在k线图实现这样的效果
1619962763789

@newproplus
Copy link

newproplus commented Oct 29, 2021

@rascaler 我也要做这种交易图表,你那边有方案了吗?

@rascaler
Copy link

@Devicegt
用多个实例,connect, 同一个实例不太好做
但是用connect也会有问题,因为十字星线会因为中间数据缺失而出现断层,需要改源码

@newproplus
Copy link

newproplus commented Nov 12, 2021

@rascaler 我的单个实例用的 graphic 做,暂时还没发现有问题,只是感觉性能上可能不太高,可能更容易卡顿.
主要是我这边要允许多个指标,数量可增可减,用grid控制布局比较容易一点

@keel
Copy link

keel commented Feb 12, 2022

希望能实现多个tooltip 的功能, trigger为'axis'时, 点击一次固定保留一条竖线, 再次点击则再保留一条竖线,以实现数据上的对比

@Ovilia Ovilia removed this from the 5.x milestone Sep 1, 2022
@Ovilia Ovilia added this to the TBD milestone Sep 1, 2022
@Veath
Copy link

Veath commented Sep 15, 2022

image
场景如上,希望实现这个功能

@CHANG-CHING-CHUNG
Copy link

CHANG-CHING-CHUNG commented Feb 2, 2023

image 场景如上,希望实现这个功能

This could be achieved by echarts.connect if you are using multiple chart instances.
Example:
CleanShot 2023-02-02 at 17 07 47

@jessemoe
Copy link

jessemoe commented Jun 28, 2023

请问这个Feature现在带上了吗?
这种深度图的多个tooltip如何实现
image

@zhaojjiang
Copy link

@joinwen 请提供一下具体的需求,为什么需要多个 tooltip,使用场景如何,期望的 option 是什么样的?

我可以提供一个我遇到的需求场景:地图+足迹,需要同时显示多个,且需要默认为展开状态

@ssjtbcf
Copy link

ssjtbcf commented Dec 12, 2023

展示多tooltip, 5.3版本支持了吗

@helgasoft
Copy link

A workaround for multiple tooltips with select and graphic - Demo Code
Deselect all selected items, or press Restore button to remove all added tooltips.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-required Further discussion is required before we decide if this issue should be fixed. new-feature priority: high topic: tooltip
Projects
Status: Pending
Development

No branches or pull requests