We are trying to generate a JPEG image using the latest trial download (V3.0.6), but we are finding that image is getting saved in the server side we are using the JSP (FusionChartsSave.jsp). The saved file size is 69 KB. But we are not able to do preview or open it in the paint (it gives an error message Paint cannot read this file). Is there any encoding that we need to do?
Please find the javascript code that we have used below. Any inputs on what could be the reason for file corruption would be great.
<script language="JavaScript">
var sdrDivChart = new FusionCharts("Column2D.swf", "sdrDivID", "600", "400", "0", "1");
<!--Initialize graph with chart data returned by generateXMLforSDR() function. [ note: the parameter 'this.document.productSelector.AnimateChart.checked' is passed to set animation property of the chart]
//loading XML data into variable strXML -->
var strXML=generateXMLforSDR();
alert(strXML);
sdrDivChart.setDataXML(strXML);
sdrDivChart.render("sdrDiv");
</script>
<BR />
<center><input type='button' value='Save Chart as Image' onClick='javascript:saveChart();'></center>
<SCRIPT LANGUAGE="JavaScript">
function saveChart(){
//Get chart from its ID
var chartToPrint = getChartFromId("sdrDivID");
alert("Before SaveASImage Method");
chartToPrint.saveAsImage();
alert("After SaveASImage Method");
}
</SCRIPT>