Integrating an On-Click Function inside a Pie Chart


I'm working on this idea that requires to integrate the OnClick function inside a PieChart. The desired result is that, when you click an specific slice of the Pie Chart it triggers an "OnClick" function which executes a different function to toggle the visibility from a "Div" object.
And if its possible, to store a value to know what slice has been click in specific, like an ID or maybe the value Text from it.

May I know if this functionality has been added to the ZingChart library? Or if there's any idea how to add this?
One of the theories I had right now is to try and attach HTML code on the text values of the chart, but this seems to break the libraries functionality.


Yes, this functionality is very possible using the node_click event that dispatches when the user clicks a node. Thereafter, you can run your desired functionalities. We've attached a screen recording and demo that you can use for reference.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us