Next
Prev

KoolChart provides the event handling features that enables you to create a custom event handler or to use the default event handling function.

This sample demonstrates how to create a new chart when the user clicks on the slice in the pie chart. Try to click on the slice in the pie chart.

...
<Pie2DChart ... itemClickJsFunction="chartClickHanlder" >
...
</Pie2DChart>
...

function chartClickHanlder(seriesId, displayText, index, data, values)
{
  alert("seriesId:"+seriesId+"\ndisplayText:"+displayText+"\nindex:"+index+"\ndata:"+data['Month']+"\nvalues:"+values[0]);
	
  // Sets the layout and dataset to create a chart dynamically.
  document.getElementById("chart2").setLayout(layoutStr2);
  document.getElementById("chart2").setData(chartData2);
}

© 2017 KoolChart. All rights reserved.