I'm trying to extract the SVG content of a zingchart generated via CFCHART and pass it to my server to convert the SVG into a PNG
$('#downloadGraph').click(function() {
zingchart.EXPORTURL = 'imageexport.cfm';
zingchart.AJAXEXPORT = true;
zingchart.exec('myChart', 'getimagedata', {
format : 'png',
callback : function(sImageData) {
console.log(sImageData);
}
});
});
However I get the following error
Uncaught TypeError: Cannot call method 'zcExec' of null
cfchart-lite.js:1
zingchart.exec_flash cfchart-lite.js:1
zingchart.exec cfchart-html.js:165
I know that the feature works because if you right click on the graph and select 'export to PNG' it works, but i want to put a button on my page to do the same action.