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

如何在多个关联的grid中分别单独显示tooltip #13630

Closed
mmm2006 opened this issue Nov 17, 2020 · 12 comments
Closed

如何在多个关联的grid中分别单独显示tooltip #13630

mmm2006 opened this issue Nov 17, 2020 · 12 comments
Labels
new-feature stale Inactive for a long time. Will be closed in 7 days. waiting-for: community

Comments

@mmm2006
Copy link

mmm2006 commented Nov 17, 2020

Version

4.9.0

Steps to reproduce

1)连接两个echart图表(都是scatter类型,横轴是time类型)
2)关联这两个echart实例
3) 在option下设置tooltip
4)鼠标移动到数据点处,两个图表一起显示tooltip

What is expected?

我们echart设置联动的目的是要拖动datazoom,其他echart有联动的效果,但是tooltip希望能单独显示,鼠标移动到哪个点,哪个点就显示tooltip。

What is actually happening?

多个tooltip会同时显示,不能单独显示。

谢谢


tooltip设置,其中axis , item都分别设置过
我在series和series下的data里面都设置过tooltip,都不会显示tooltip,formatter函数也不会被调用。可是文档里面是说可以设置。

请问有什么解决方法。这个可能不是bug,但是不知道如何解决。谢谢

{
          show: true,
          //触发点
          triggerOn: 'click',
          // trigger: 'axis',  //axis , item
          backgroundColor: 'rgba(0,15,78,0.6)',
          borderColor: '#00afff',
          borderWidth: 1,
          borderRadius: 0,
          color: 'red',
          //会出现间断线,不适合
          // axisPointer: {
          //   type: 'cross'
          // },
          formatter: function (value) {
            console.log('formatter is called', value)
            return "123456"
          },
          // formatter: '{b0}: {c0}<br />{b1}: {c1}',
          textStyle: {
            color: "#fff",
            fontSize: 13,
            align: 'left'
          },
        }
@echarts-bot
Copy link

echarts-bot bot commented Nov 17, 2020

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added bug en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Nov 17, 2020
@plainheart plainheart removed the en This issue is in English label Nov 17, 2020
@mmm2006
Copy link
Author

mmm2006 commented Nov 17, 2020

error

@mmm2006
Copy link
Author

mmm2006 commented Nov 17, 2020

五个chart图,关联在一起,点击了一个点(红色圈),其他的tooltip也会显示(篮圈),希望只有一个有tooltip

@mmm2006
Copy link
Author

mmm2006 commented Nov 19, 2020

文档 可以在series 和series里面的data里面分别设置tooltip,但是我设置了没有效果,请问应该如何才能用,给个例子我研究下也可以。多谢了

@pissang
Copy link
Contributor

pissang commented Nov 19, 2020

暂时不支持多 tooltip,图示这种建议用标签显示

@mmm2006
Copy link
Author

mmm2006 commented Nov 19, 2020

暂时不支持多 tooltip,图示这种建议用标签显示
@pissang ,我没有明白您的意思,我现在的问题是想单独显示tooltip,就是点哪个图表的点,就显示哪个点的信息,目前的现象是点一个点,其他的图表上的tooltip(这些事connect的)也会显示出来。谢谢您的帮助

@pissang
Copy link
Contributor

pissang commented Nov 19, 2020

@mmm2006 抱歉我以为你想要显示多个 tooltip,现在联动的话是强制关联了 tooltip,如果只希望 dataZoom,可以手动关联一下

chart1.on('datazoom', function (params) {
  chart2.dispatchAction(chart2.makeActionFromEvent(params));
});

@plainheart plainheart added new-feature and removed bug pending We are not sure about whether this is a bug/new feature. labels Nov 19, 2020
@mmm2006
Copy link
Author

mmm2006 commented Nov 19, 2020

@pissang 非常感谢您的帮助。我试了下,确实是可以实现datazoom的联动。我有多个图表,操作哪个图表,就要把事件传个其他的图表,是这样吗?是否会陷入互相传递的死循环。

@pissang
Copy link
Contributor

pissang commented Nov 19, 2020

死循环这个可以通过一个 flag 标记一下,现在 echarts 内部也是这么做的

@mmm2006
Copy link
Author

mmm2006 commented Nov 19, 2020

@pissang,您好,能给我大致说说思路吗? 我这里是有一个主要的图表,下面关联的是一个图表的列表,个数不定。都能彼此通过鼠标滑动来操作时间轴,实现图表数据的同步滚动展示。我没有想清楚如何通过标记区分,是通过参数里面的数据值,判断事件的来源,区分是不是应该传递事件,是吗? 谢谢您

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label Nov 19, 2022
@github-actions
Copy link
Contributor

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature stale Inactive for a long time. Will be closed in 7 days. waiting-for: community
Projects
None yet
Development

No branches or pull requests

3 participants