Export

Export

downloadCSV

Download the chart data in .csv format.

zingchart.exec('myid', 'downloadCSV', {
  fn: 'test-filename'
});
ParameterTypeDescription
fnString

The filename to download. No extension required. Default name is based on chart id.

"test-filename"

downloadXLS

Download the chart data in .xls format.

zingchart.exec('myid', 'downloadXLS', { 
  fn: 'test-filename' 
});
https://app.zingsoft.com/demos/embed/B7637U9H
https://app.zingsoft.com/demos/embed/B7637U9H
ParameterTypeDescription
fnString

The filename to download. No extension required. Default name is based on chart id.

"test-filename"

downloadRAW

Download the raw data from chart.

zingchart.exec('myid', 'downloadRAW', { 
  fn: 'test-filename.txt', 
  callback: function(e) { console.log(arguments); document.getElementById('output').innerHTML = JSON.stringify(arguments); } 
});
https://app.zingsoft.com/demos/embed/5CNSP9W1
https://app.zingsoft.com/demos/embed/5CNSP9W1
ParameterTypeDescription
callbackFunctionAn inline function callback that will receive the raw data AND the function name if defined.
fnString

The filename to download. No extension required. Default name is based on chart id.

"test-filename"

exportdata

Exports the current data. Only works if exportdataurl is set in zingchart.render or url parameter is set.

zingchart.exec('myid', 'exportdata');

getimagedata

Returns a Base64 encoded image string. Returns -1 if failed to get image data.

zingchart.exec('myid', 'getimagedata', {
    filetype: 'png'
});
https://app.zingsoft.com/demos/embed/YHA4PC5Z
https://app.zingsoft.com/demos/embed/YHA4PC5Z

Note: charts with output: 'svg' must get data inside callback function defined in the method call. SVG output is the default for ZingChart.

https://app.zingsoft.com/demos/embed/I9JFJ01A
https://app.zingsoft.com/demos/embed/I9JFJ01A
ParameterTypeDescription
filetype/formatString

The image filetype. The default is jpg. Other options are bmp (flash only) and png.

"png" | "jpg" | "bmp" (flash only)

callbackFunction

The callback function is used for svg charts exporting

function(imagedata) {...}

Creates a printable version of the chart and attempts to print it.

zingchart.exec('myid', 'print');
https://app.zingsoft.com/demos/embed/CDJWAX8X
https://app.zingsoft.com/demos/embed/CDJWAX8X

saveasimage/exportimage

Produces an image of the graph. Only works if exportimageurl is set in zingchart.render or url parameter is set.

zingchart.exec('myid', 'saveasimage');