javascript amCharts graph item click event

Vivek picture Vivek · Oct 1, 2012 · Viewed 16.5k times · Source

In amCharts flash chart there is a event name clickGraphItem which work as click on graph item and after fetching this event we can do any action on graph item click.

I need the same functionality in javascript amCharts. So is it possible to implement clickGraphItem in javascript amCharts?

Please provide solution. Any source code would be appreciated.

Answer

zeroin picture zeroin · Oct 1, 2012

You can add event handlers to the AMCharts Javascript library in the following way

// add click listener
chart.addListener("clickGraphItem", handleClick);

Here is jsFiddle for this:

http://jsfiddle.net/amcharts2/cV8GG/