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 2019/09/05 14:50:37 UTC

[GitHub] [incubator-echarts] OlmoBarberis edited a comment on issue #2941: Handling click events on chart grid columns

OlmoBarberis edited a comment on issue #2941: Handling click events on chart grid columns
URL: https://github.com/apache/incubator-echarts/issues/2941#issuecomment-528407965
 
 
   > But when I click between two columns, I can not receive any event. I wish I can get the dataIndex where the blue line located. Any idea? @coretez
   > 
   > ![image](https://user-images.githubusercontent.com/1694541/34925970-9af9a352-f9e7-11e7-9027-f7817d241296.png)
   
   Have you tried with:
   `const zr = chart.getZr();
    zr.on('click', (params) => {
       console.log(params);
   });`
   
   You can take extract coordinates from params and get dataIndex with chart.convertFromPixel.
   
   I have used it in my project and I had found an example that used getZr() but I can't find it again now!

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