rohitg Report post Posted April 16, 2009 I am trying to invoke the saveImage using java script, function saveChart(catId) { var chartId = "chart"+catId; var ch = getChartFromId(chartId); ch.saveAsImage(); } This doesn't seem to be working when I use the "createChartHTML" present in the FusionChart.jsp page, but the saveimage in the right click context menu is working. However if I use "createChart" method in the same file, it works, but I am scenario I need to use the html method, since they whole chart object comes in the AJAX response. Could you please tell me what I can do to archive this. Regards, Rohit Share this post Link to post Share on other sites
rohitg Report post Posted April 17, 2009 Can anyone from fusion charts team answer this, coz this is important for me. Please let me know if this cannot be achieved and there is a bug or anything. Regards, Rohit Share this post Link to post Share on other sites
Rahul Kumar Report post Posted April 17, 2009 Hi, You would need to modify the FusionCharts.jsp file as below: public String createChartHTML(String chartSWF, String strURL, String strXML, String chartId, int chartWidth, int chartHeight, boolean debugMode) { /*Generate the FlashVars string based on whether dataURL has been provided or dataXML.*/ String strFlashVars = ""; Boolean debugModeBool = new Boolean(debugMode); if (strXML.equals("")) { //DataURL Mode strFlashVars = "chartWidth=" + chartWidth + "&chartHeight=" + chartHeight + "&debugMode=" + boolToNum(debugModeBool) + "&dataURL=" + strURL + ""; } else { //DataXML Mode strFlashVars = "chartWidth=" + chartWidth + "&chartHeight=" + chartHeight + "&debugMode=" + boolToNum(debugModeBool) + "&dataXML=" + strXML + ""; } strFlashVars = strFlashVars + "®isterWithJS=1"; StringBuffer strBuf = new StringBuffer(); The registerWithJS=1 parameter is required when you are working with JavaScript ExternalInterface i.e. saveAsImage();. Share this post Link to post Share on other sites
FusionCharts Support Report post Posted April 17, 2009 Hi, You can also add ?registerWithJS=1 at the end of the SWF file name while providing in createChartHTML() function. Share this post Link to post Share on other sites
rohitg Report post Posted June 17, 2009 This doesn't seem to be working with IE 8, keep getting the error "Object Doesn't support this property or method" Share this post Link to post Share on other sites