Unable to add event listener to pie chart segment
See original GitHub issueI want to add a mouseover event listener to a pie chart segment; I thought I’d be able to do this on chartist’s draw event, but the e.element
points to an object whose prototype is Chartist.Svg
, and that exposes no way I can see to add an event to the element without using its presumably internal _node
property.
It would be nice to expose the actual DOM node somehow, or at least make it possible to add/remove event listeners.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
Google Chart : How do I add select event handler to the pie ...
problem has to do with scope. selectHandler is outside of the function handlePieChartResponse. so it can't be found.
Read more >custom events not working? · Issue #610 · chartjs/Chart.js
Clicking on a pie segment doesn't seem to do anything. ... addEventListener('click', function(evt){ var segmentsInRange = window.myPie.
Read more >Interacting With the Chart - Google Developers
Listening for events is simple; simply call google.visualization.events.addListener() passing in a handle to the chart, the name of the ...
Read more >Dynamically Add Chart Event Listener using Plain JS
This article tells you how to dynamically add chart event listener to your chart using plain JS.
Read more >ag-Charts: Pie and Doughnut Series - AG Grid
This section shows how to create pie charts. Pie series are used for showing how parts relate to the whole, for example if...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, let’s use this ticket to track this. Adding a public
getNode
method would be appreciated.Confirming this, same problem with onClick / onMouseUp. I was unable to find a simple way to add individual events to each pie chart segment.