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/03/31 06:25:51 UTC

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

SevenOutman opened a new issue #12355: echarts.connect 使用 dataName 作为联动的标识
URL: https://github.com/apache/incubator-echarts/issues/12355
 
 
   ### What problem does this feature solve?
   我使用 echarts.connect 来使我的多个图表联动,现在看起来 tooltip 的联动是发生在相同的 dataIndex 上,而 legend 的联动却发生在 dataName 上,表现不一致。
   
   例如,我有两个图表,分别传入同一组数据的正序和倒序,此时 tooltip 的联动是错乱的,如当我在图一中 hover “周一”的数据,图二会显示“周日”的 tooltip。而当我在 legend 中关闭“周一”,两图的“周一”数据均消失。
   
   我想,tooltip 的联动应该也同 legend 一样,使用 dataName 来判断“相同的指标”。或者,可以为 `echarts.connect` 方法提供选项来设置联动的方式。
   
   ### What does the proposed API look like?
   `echarts.connect(group, options)`
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
100pah commented on issue #12355: echarts.connect 使用 dataName 作为联动的标识
URL: https://github.com/apache/incubator-echarts/issues/12355#issuecomment-608632143
 
 
   当前版本的联动如果不合要求,只能不使用 `echarts.connect(group, options)` 而是直接用 `on` 和 `dispatchAction` 来实现定制的联动。
   
   因为比较难于猜得到,具体是按什么联动。
   所以,我认为,联动,应该有更方便的定制,修改联动的细节,比较好。例如:
   
   ```js
   echarts.connect(groups, {
       includeEvents: ['showTip'], // 如果有此设定,只联动这些 events。
       makeActionFromEvent: function(event) {
           var action;
           if (event.type === 'showTip') {
              ...
           }
           else {
               action = echarts.makeActionFromEvent(event)
           }
           return action;
       }
   });
   ```
   
   

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12355: echarts.connect 使用 dataName 作为联动的标识
URL: https://github.com/apache/incubator-echarts/issues/12355#issuecomment-606426329
 
 
   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](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) 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 dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
   
   If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
100pah commented on issue #12355: echarts.connect 使用 dataName 作为联动的标识
URL: https://github.com/apache/incubator-echarts/issues/12355#issuecomment-609447358
 
 
   @SevenOutman 如果使用的是 `tooltip.trigger: 'axis'` 且有多个 series,
   那么 showTip 则可不传 seriesIndex 。

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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