oliew Report post Posted November 30, 2009 Hello, ive been trying really hard to get fusioncharts to popup a jpg to save a chart, ive enabled the exports and i get the save as jpg button, it says capturing data and gets to 100% then nothing... I have the "waiting" in the div there too.. it doesnt change. Here is my code im using everything works apart from the save as. hope you can help regards Oliew <?php include("FusionCharts.php") ?> <script language="JavaScript" src="FusionCharts.js" type="text/javascript"></script> <script language="JavaScript" src="FusionChartsExportComponent.js" type="text/javascript"></script> <? php $strXML = "<chart caption='Near " . $company_name . "' subcaption='For 2009' xAxisName='ID No.' yAxisName='Number of Near Misses' shownames='1' showvalues='1' showSum='1' decimals='0' useRoundEdges='1' exportEnabled='1' exportHandler='fcExporter_' registerWithJS='1' exportAtClient='1' exportFormats='JPEG=Save as JPEG' >"; $strXML .= "<categories>"; $strXML .= "<category label='01' /> "; $strXML .= "<category label='02' /> "; $strXML .= "</categories>"; $strXML .= "<dataset seriesName='" . $company_name . " Near ' color='F6BD0F' >"; $strXML .= " <set value='" . $NMCC_ID01 . "' />"; $strXML .= " <set value='" . $NMCC_ID02 . "' />"; $strXML .= "</dataset>"; $strXML .= " <dataset seriesName='Near ' color='1c6c73'>"; $strXML .= " <set value='" . $ALL_NMCC_ID01 . "' />"; $strXML .= " <set value='" . $ALL_NMCC_ID02 . "' />"; $strXML .= " </dataset>"; //Close <chart> element $strXML .= "</chart>"; echo renderChart("MSColumn2D.swf", "", $strXML, "Sales", 920, 400, false, false); ?> <div id="fcexpDiv" align="center">FusionCharts Export Handler Component</div> <script type="text/javascript"> var myExportComponent = new FusionChartsExportObject("fcExporter_", "FCExporter.swf"); myExportComponent.Render("fcexpDiv"); </script> Share this post Link to post Share on other sites
saurabh Report post Posted December 2, 2009 Hi, I had the same problem. For some reason I was not able to save the chart as image/pdf while using PHP. Don't know if its a bug or what. But the following javascript code worked. //Callback handler method which is invoked after the chart has saved image on server. function myCallBackFunction(objRtn) { if (objRtn.statusCode=="1") { alert('success'); } else { alert("The chart could not be saved on server. There was an error. Description : " + objRtn.statusMessage); } } var myChart = new FusionCharts("/FusionCharts/Bar2D.swf", "myChartId", "771", "500", "0", "1"); myChart.setDataURL('data.xml'); // This file contains my xml myChart.render("listing"); // Listing is my div id. Just watchout for the last parameter of function FusionCharts. It should be true. Let me know if it works. Share this post Link to post Share on other sites
saurabh Report post Posted December 2, 2009 Sorry for the previous post. But don't know I have faced this problem previously on this forum. Cann't seems to get over it. You could look into the source code of this page to check my code in previous post. Share this post Link to post Share on other sites
oliew Report post Posted December 2, 2009 hi, thanks for the post yes it seems alot of ppl have this problem. i actually got it working about 4 hours ago with this code: exportEnabled='1' exportHandler='FCExporter.php' exportAtClient='0' exportFormats='JPEG=Save as JPEG' that goes inside the <chart>. thanks for the help! Oli Share this post Link to post Share on other sites
Guest Madhumita Report post Posted December 2, 2009 Hello Oli, Thank you for your inputs. It really helps everyone out in this forum. Share this post Link to post Share on other sites
oliew Report post Posted December 2, 2009 no probs glad to be of help Oli Share this post Link to post Share on other sites
Guest Madhumita Report post Posted December 2, 2009 Hello, Happy FusionCharting. Share this post Link to post Share on other sites