You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/04/04 04:29:59 UTC

[GitHub] [incubator-echarts] SevenOutman commented on issue #12355: echarts.connect 使用 dataName 作为联动的标识

SevenOutman commented on issue #12355: echarts.connect 使用 dataName 作为联动的标识
URL: https://github.com/apache/incubator-echarts/issues/12355#issuecomment-608971731
 
 
   > 当前版本的联动如果不合要求,只能不使用 `echarts.connect(group, options)` 而是直接用 `on` 和 `dispatchAction` 来实现定制的联动。
   
   现在我的确是使用 `on` 和 `dispatchAction` 来实现 tooltip 联动的,大致实现如下:
   ```
   echarts.on('mouseover', 'series', function (params) {
     siblings.forEach(function (sibling) {
       sibling.dispatchAction({
         type: 'showTip',
         seriesIndex: params.seriesIndex,
         name: params.name
       });
     });
   });
   
   echarts.on('mouseout', 'series', function () {
     siblings.forEach(function (sibling) {
       sibling.dispatchAction({
         type: 'hideTip'
       });
     });
   });
   ```
   
   这样基本实现了我需要的联动,唯独一种情况下存在 bug。当我的图表中存在多个 `series` 时(比如两个 bar 和一个 line),联动会失效,联动图表上没有 tooltip 出现。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org