Next
Update
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 chart is to show how to display a notification message when the chart data is empty.

You can check if a dataset is empty using the JavaScript function, and if the dataset is empty, then you can call hasNoData with setting the argument to "true" to display a notification.

...
var chartData = [];	

...

function chartReadyHandler(id)
{
  document.getElementById(id).setLayout(layoutStr);
  document.getElementById(id).setData(chartData);
  checkData(chartData);
}

function checkData(data)
{
  if(data.length <= 0) // No data exists
    document.getElementById("chart1").hasNoData(true);
}

© 2017 KoolChart. All rights reserved.