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 2022/06/17 07:32:17 UTC

[GitHub] [echarts] zsytssk opened a new issue, #17238: [Feature] 通过data来获取 dataIndex

zsytssk opened a new issue, #17238:
URL: https://github.com/apache/echarts/issues/17238

   ### What problem does this feature solve?
   
   工作中遇到一个需求在页面上显示两个echarts图表,使用的是同一个套数据;当一个图表中点击之后,另一个图表中对应的元素需要高亮之类的。我在官网的api找了一圈,发现可以通过`myChart.dispatchAction`来触发事件,但是他需要dataIndex;而我找了一圈,也没有找到通过数据来获取dataIndex的接口,我唯一发现相关的是在监听节点的事件里面来获取对应的dataIndex。
   
   我想这是一个需求比较高的接口,可以大大的提高echarts的交互性。
   
   ### What does the proposed API look like?
   
   工作中遇到一个需求在页面上显示两个echarts图表,使用的是同一个套数据;当一个图表中点击之后,另一个图表中对应的元素需要高亮之类的。我在官网的api找了一圈,发现可以通过`myChart.dispatchAction`来触发事件,但是他需要dataIndex;而我找了一圈,也没有找到通过数据来获取dataIndex的接口,我唯一发现相关的是在监听节点的事件里面来获取对应的dataIndex。
   
   我想这是一个需求比较高的接口,可以大大的提高echarts的交互性。


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [echarts] zsytssk commented on issue #17238: [Feature] 通过data来获取 dataIndex

Posted by GitBox <gi...@apache.org>.
zsytssk commented on issue #17238:
URL: https://github.com/apache/echarts/issues/17238#issuecomment-1312324759

   > @zsytssk Please provide a demo for the issue either with [Official Editor](https://echarts.apache.org/examples/editor.html), [CodePen](https://codepen.io/Ovilia/pen/dyYWXWM), [CodeSandbox](https://codesandbox.io/s/echarts-basic-example-template-mpfz1s) or [JSFiddle](https://jsfiddle.net/plainheart/e46ozpqj/7/).
   
   关了吧,我应该是通过你的回复解决我自己的问题


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #17238: [Feature] 通过data来获取 dataIndex

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #17238:
URL: https://github.com/apache/echarts/issues/17238#issuecomment-1158600388

   @zsytssk Please provide a demo for the issue either with [Official Editor](https://echarts.apache.org/examples/editor.html), [CodePen](https://codepen.io/Ovilia/pen/dyYWXWM), [CodeSandbox](https://codesandbox.io/s/echarts-basic-example-template-mpfz1s) or [JSFiddle](https://jsfiddle.net/plainheart/e46ozpqj/7/).


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [echarts] zsytssk closed issue #17238: [Feature] 通过data来获取 dataIndex

Posted by GitBox <gi...@apache.org>.
zsytssk closed issue #17238: [Feature] 通过data来获取 dataIndex
URL: https://github.com/apache/echarts/issues/17238


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #17238: [Feature] 通过data来获取 dataIndex

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #17238:
URL: https://github.com/apache/echarts/issues/17238#issuecomment-1158582061

   @zsytssk It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Feature] Get dataIndex through data
   
   **BODY**
   
   ### What problem does this feature solve?
   
   A requirement was encountered at work to display two echarts charts on the page, using the same set of data; When clicking in one chart, the corresponding element in the other chart needs to be highlighted or something. I looked around the API on the official website and found that the event could be triggered through 'myChart.dispatchAction', but he needed dataIndex; And I looked around, and did not find the interface to get dataIndex through data, the only thing I found was related to the event of the listening node to get the corresponding dataIndex.
   
   I think this is a relatively demanding interface, which can greatly improve the interactivity of echarts.
   
   ### What does the proposed API look like?
   
   A requirement was encountered at work to display two echarts charts on the page, using the same set of data; When clicking in one chart, the corresponding element in the other chart needs to be highlighted or something. I looked around the API on the official website and found that the event could be triggered through 'myChart.dispatchAction', but he needed dataIndex; And I looked around, and did not find the interface to get dataIndex through data, the only thing I found was related to the event of the listening node to get the corresponding dataIndex.
   
   I think this is a relatively demanding interface, which can greatly improve the interactivity of echarts.
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [echarts] Ovilia commented on issue #17238: [Feature] 通过data来获取 dataIndex

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17238:
URL: https://github.com/apache/echarts/issues/17238#issuecomment-1158600236

   > 在页面上显示两个echarts图表,使用的是同一个套数据;当一个图表中点击之后,另一个图表中对应的元素需要高亮之类的。 
   
   这个需求的常见解法是 [`connect`](https://echarts.apache.org/zh/api.html#echarts.connect),test 下也有[一些例子](https://github.com/apache/echarts/tree/master/test),可以搜 `connect`。
   
   按你说的 `dispatchAction` 也是可以的,点击事件本身应该是带有 `dataIndex` 的,如果没有的话提供一下例子吧。


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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