JavaScript Hook for 'Save as Image'
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



JavaScript Hook for 'Save as Image' Expand / Collapse
Author
Message
Posted 1/23/2008 9:51:47 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/22/2008 9:37:53 PM
Posts: 2, Visits: 5
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.
Post #4041
Posted 1/23/2008 11:44:39 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 2:56:41 AM
Posts: 704, Visits: 1,139
hi,

We are afraid, FusionCharts does not, as yet, expose the JS API to hook image saving function. But we are working on this.

Regards,

Sudipto Choudhury
FusionCharts Team

Post #4046
Posted 3/7/2008 2:20:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/18/2008 2:50:56 AM
Posts: 9, Visits: 24
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?


Dharmendra
Post #4992
Posted 3/7/2008 7:48:16 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 2:56:41 AM
Posts: 704, Visits: 1,139
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.

Regards,

Sudipto Choudhury
FusionCharts Team

Post #4993
Posted 3/10/2008 9:55:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/18/2008 2:50:56 AM
Posts: 9, Visits: 24
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


Dharmendra
Post #5008
Posted 3/11/2008 7:16:40 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 2:56:41 AM
Posts: 704, Visits: 1,139
Hi,

All features are enabled in Eval version.

Regards,

Sudipto Choudhury
FusionCharts Team

Post #5016
Posted 4/11/2008 3:43:19 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/29/2008 12:08:35 PM
Posts: 6, Visits: 17
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&registerWithJS=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&registerWithJS=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 .

Post #5590
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 9:36pm


Execution: 0.063.