question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to add event listener to pie chart segment

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
gionkunzcommented, May 1, 2016

Well, let’s use this ticket to track this. Adding a public getNode method would be appreciated.

1reaction
pareznikcommented, Apr 30, 2016

Confirming this, same problem with onClick / onMouseUp. I was unable to find a simple way to add individual events to each pie chart segment.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found