﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FusionCharts Forum / FusionCharts v3 / Using FusionCharts / JavaScript Problems  / JavaScript Hook for 'Save as Image' / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FusionCharts Forum</description><link>http://www.fusioncharts.com/forum/</link><webMaster>support@fusioncharts.com</webMaster><lastBuildDate>Tue, 07 Oct 2008 00:03:08 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: JavaScript Hook for 'Save as Image'</title><link>http://www.fusioncharts.com/forum/Topic4041-35-1.aspx</link><description>Hi,&lt;P&gt;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:  &lt;/P&gt;&lt;P&gt;so.addParam("FlashVars","&amp;amp;dataURL=cache/myfile.xml&amp;amp;registerWithJS=1");&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;lt;SCRIPT LANGUAGE="JavaScript"&amp;gt;&lt;BR&gt;      function saveChart(chartID){                  &lt;BR&gt;         var chartToPrint = getChartFromId(chartID);         &lt;BR&gt;         chartToPrint.saveAsImage();&lt;BR&gt;      }&lt;BR&gt;&amp;lt;/SCRIPT&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;lt;script type="text/javascript"&amp;gt;         &lt;BR&gt;    var so = new FusionCharts('FusionCharts/Area2D.swf', &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;'chart1Id','600','400','0','1','FFFFFF','exactFit','','8');    &lt;BR&gt;    so.addParam("type", "application/x-shockwave-flash");&lt;BR&gt;    so.addParam("id", "chart1Id");        &lt;BR&gt;    so.addParam("FlashVars","&amp;amp;dataURL=cache/myfile.xml&amp;amp;registerWithJS=1");&lt;BR&gt;    so.addParam("movie", "FusionCharts/Area2D.swf");&lt;BR&gt;    so.addParam("quality", "high");&lt;BR&gt;    so.addParam("menu", "true"); &lt;BR&gt;    so.addParam("wmode", "opaque");         &lt;BR&gt;    so.addParam("pluginurl", "&lt;/FONT&gt;&lt;A href="http://www.macromedia.com/go/getflashplayer"&gt;&lt;FONT face="Courier New"&gt;http://www.macromedia.com/go/getflashplayer&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;");    &lt;BR&gt;    so.render("chart1div");&lt;BR&gt;   &amp;lt;/script&amp;gt;  &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="" onClick="saveChart('chart1Id');"&amp;gt;Save Chart&amp;lt;/a&amp;gt;&lt;P&gt;I hop this helps someone out there ;).</description><pubDate>Fri, 11 Apr 2008 15:43:19 GMT</pubDate><dc:creator>Deb.Penny</dc:creator></item><item><title>RE: JavaScript Hook for 'Save as Image'</title><link>http://www.fusioncharts.com/forum/Topic4041-35-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;All features are enabled in Eval version.</description><pubDate>Tue, 11 Mar 2008 07:16:40 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>RE: JavaScript Hook for 'Save as Image'</title><link>http://www.fusioncharts.com/forum/Topic4041-35-1.aspx</link><description>Hi ,&lt;br&gt;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?&lt;br&gt;&lt;br&gt;Thanks</description><pubDate>Mon, 10 Mar 2008 09:55:19 GMT</pubDate><dc:creator>dharmendra</dc:creator></item><item><title>RE: JavaScript Hook for 'Save as Image'</title><link>http://www.fusioncharts.com/forum/Topic4041-35-1.aspx</link><description>hi,&lt;/P&gt;&lt;P&gt;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  -  &lt;A href="http://www.fusioncharts.com/docs/Contents/JS_saveAsImage.html "&gt;http://www.fusioncharts.com/docs/Contents/JS_saveAsImage.html &lt;/A&gt;for more on this.</description><pubDate>Fri, 07 Mar 2008 07:48:16 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>RE: JavaScript Hook for 'Save as Image'</title><link>http://www.fusioncharts.com/forum/Topic4041-35-1.aspx</link><description>Hi ,&lt;br&gt;&lt;br&gt;  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?</description><pubDate>Fri, 07 Mar 2008 02:20:16 GMT</pubDate><dc:creator>dharmendra</dc:creator></item><item><title>RE: JavaScript Hook for 'Save as Image'</title><link>http://www.fusioncharts.com/forum/Topic4041-35-1.aspx</link><description>hi,&lt;/P&gt;&lt;P&gt;We are afraid, FusionCharts does not, as yet, expose the JS API to hook image saving function. But we are working on this.</description><pubDate>Wed, 23 Jan 2008 23:44:39 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>JavaScript Hook for 'Save as Image'</title><link>http://www.fusioncharts.com/forum/Topic4041-35-1.aspx</link><description>Does a JavaScript hook/function exist for the "Save As Image" menu item to make that publicly available (via actionscript) to the JavaScript API? &lt;br&gt;&lt;br&gt;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.</description><pubDate>Wed, 23 Jan 2008 21:51:47 GMT</pubDate><dc:creator>augustd</dc:creator></item></channel></rss>