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/03/02 10:10:56 UTC

[GitHub] [echarts] MNHarshitha opened a new issue #16609: Click Event On Series Label[Feature]

MNHarshitha opened a new issue #16609:
URL: https://github.com/apache/echarts/issues/16609


   ### What problem does this feature solve?
   
   Hi,
   We have a requirement where we need to trigger a click event on the series labels.
   
   ![image](https://user-images.githubusercontent.com/97500674/156339111-008ccbcf-60e8-4dbf-b61f-77353bf5fb02.png)
   
   we tried using the below code:
   
   myChart.on('click','series.label', callback);
   
   But this doesn't seem to work.
   
   sample: https://codepen.io/pen/ 
   
   Please let us know how we can trigger a click event on the series labels.
   
   
   ### What does the proposed API look like?
   
   Similar to the series click event, we are looking for a way to trigger a click event on the series labels.a 


-- 
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] xiaochuan1719 commented on issue #16609: Click Event On Series Label[Feature]

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


   Yeah! I have the same needs ... but, I can‘t achieve ... 


-- 
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] plainheart commented on issue #16609: Click Event On Series Label[Feature]

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


   ```js
   myChart.on('click', e => {
     if (e.componentType === 'series') {
       const target = e.event.target;
       if(target.type === 'tspan') {
         console.log('label', target.style.text, 'was clicked', e)
       }
     }
   })
   ```
   


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