Prev
Save as CSV

This sample chart demonstrates how to save the chart data as a CSV file. Try to click on the button at the bottom left of the chart.

function saveToCSV()
{
  menus.items[0].callback();
}

var menus = {
  options : {
    textField : "name", // for the menu item
    callbackField : "callback" // for the callback function when the menu item is clicked
  }, 
  items : [
    {
      name : "Save as CSV",
      callback : function() {
        KoolChart.downloadToLocal("KoolChart", "csv", "http://www.koolchart.com/hsyu/downloadLocal.jsp", function() {
          return document.getElementById("chart1").getCSVData();
        });
      }
    }
  ]
};

© 2017 KoolChart. All rights reserved.