javascript - ArmCharts makechart with click events -
i'm new here bear question i'm going ask.
i want create click event armcharts piechart. example, when user click pie chart, open new popup window.
my code follow
chart = amcharts.makechart("piechart-placeholder2", { "type": "pie", "fontsize": 9.5, "labeltext": "[[percents]]%", "theme": "light", "legend": { "markertype": "circle", "position": "right", "marginright": 80, "automargins": false }, "dataprovider": [{ "perkara": "xxx1", "amaun(rm)": 4444 }, { "perkara": "xxx2", "amaun(rm)": 5555 }, { "perkara": "xxx3", "amaun(rm)": 73344 }, { "perkara": "xxx4", "amaun(rm)": 3322 }, { "perkara": "xxx5", "amaun(rm)": 56544 }], "valuefield": "amaun(rm)", "titlefield": "perkara", "balloontext": "[[title]]<br><span style='font-size:14px'><b>rm [[value]]</b> ([[percents]]%)</span>", "exportconfig": { "menutop":"0px", "menuitems": [{ "icon": 'assets/img/export.png', "format": 'png' }] } });
i know addlistener
method, don't know how apply here.
thank you!
you can add event listener amchart this.
// add click listener chart.addlistener("clickitem", handleclick);
Comments
Post a Comment