augustd Report post Posted January 23, 2008 Does a JavaScript hook/function exist for the "Save As Image" menu item to make that publicly available (via actionscript) to the JavaScript API? We want to create a button on the page so that users can download their chart as a JPEG without having to right-click on the chart itself. Otherwise they may never know that the option to download exists. Share this post Link to post Share on other sites
FusionCharts Support Report post Posted January 23, 2008 hi, We are afraid, FusionCharts does not, as yet, expose the JS API to hook image saving function. But we are working on this. Share this post Link to post Share on other sites
dharmendra Report post Posted March 7, 2008 Hi , I want to save the charts as image and then move it into the pdf file using javascript. I downloaded v3 evaluation version .I try to do it the same . But I find an error in FusionCharts.js . When i try save the chart it hows an error "chartToPrint.saveAsImage() does not support method". So Could you please provide the details or any source code? Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 7, 2008 hi, Though I am writing this long after v3.0.6 launch, since then FusionCharts supports Image saving API call using JavaScript. For this you need to set register with JS option on. That will not give the error that you are mentioning. Please refer to our online documentaion's page - http://www.fusioncharts.com/docs/Contents/JS_saveAsImage.html for more on this. Share this post Link to post Share on other sites
dharmendra Report post Posted March 10, 2008 Hi , I did it the same as mentioned in the link( as you provided ) .I throws the javascript error for saveAsImage function .I also set JS variable. I copy the same as mentioned in documentation along with the required changes.I am using evaluation version .This version provides such facility or not .Can you please confirm me. Is there any work around? Thanks Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 11, 2008 Hi, All features are enabled in Eval version. Share this post Link to post Share on other sites
Deb.Penny Report post Posted April 11, 2008 (edited) Hi, I finally figured out what the issue was with the charttoprint object does not support that method or property error in IE that I was receiving. I figured it out that I have to call registerWithJS on the FlashVars param in order for IE to to acknowledge the OBJECT's id as in: so.addParam("FlashVars","&dataURL=cache/myfile.xml®isterWithJS=1"); Once I provided that, it worked fine. I was relying on the "1" flag on the new instantiation function but it ignores that in IE. Here's what I ended up using that works: <SCRIPT LANGUAGE="JavaScript"> function saveChart(chartID){ var chartToPrint = getChartFromId(chartID); chartToPrint.saveAsImage(); } </SCRIPT> <script type="text/javascript"> var so = new FusionCharts('FusionCharts/Area2D.swf', 'chart1Id','600','400','0','1','FFFFFF','exactFit','','8'); so.addParam("type", "application/x-shockwave-flash"); so.addParam("id", "chart1Id"); so.addParam("FlashVars","&dataURL=cache/myfile.xml®isterWithJS=1"); so.addParam("movie", "FusionCharts/Area2D.swf"); so.addParam("quality", "high"); so.addParam("menu", "true"); so.addParam("wmode", "opaque"); so.addParam("pluginurl", "http://www.macromedia.com/go/getflashplayer"); so.render("chart1div"); </script> <a href="" onClick="saveChart('chart1Id');">Save Chart</a> I hop this helps someone out there . Edited April 11, 2008 by Guest Share this post Link to post Share on other sites