Sign in to follow this  
suede

"chartToPrint.saveAsImage is not a function" using Fusioncharts ver3.0.7

Recommended Posts

Hi,

 

We just bought Fusioncharts Prof about a week ago.

 

I can save the image by right clicking -> save as image.

 

But I have difficulty when trying to invoke that using javascript.

 

I follow the direction from http://www.fusioncharts.com/Docs/Contents/JS_saveAsImage.html; include the FusionCharts.js and saveChart() js function.

 

But still get error chartToPrint.saveAsImage is not a function.

 

I debug the chart and I get the version is 3.0.7 and I tried using both IE7 and FF3

 

 

 

Can you please help?

 

 

 

thanks,

 

Ferry

Share this post


Link to post
Share on other sites

in your manual http://www.fusioncharts.com/Docs/Contents/JS_saveAsImage.html

 

=============================================================

 

The first step is to set registerWithJS flag of chart as 1, as shown under:

 

 

 

 

FusionCharts

 

 

 

var chart1 = new FusionCharts("../../FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "1");

 

chart1.setDataXML("");

 

chart1.render("chart1div");

 

 

==============================================================

 

But then you never state registerWithJS in you sample code? :ermm:

Share this post


Link to post
Share on other sites

Ok, I just find the solution

 

 

 

in the manual

 

 

 

var chart1 = new FusionCharts("../../FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "1");

 

 

 

change to

 

 

 

var chart1 = new FusionCharts("../../FusionCharts/Column3D.swf?registerWithJS=1", "chart1Id", "400", "300", "0", "1");

 

 

 

Another question, can I attach some information to the chart using that javascript invoke method before it post back to FusionChartsSave.php? ie: I want to add user_id so when PHP script generate image it'll save to certain folder with certain name and I can do further process. My main purpose is to create PDF with image of the chart.

 

 

 

Thanks,

 

Ferry

Share this post


Link to post
Share on other sites

Ferry,

 

 

 

I'm afraid currently we do not support any addition of data to the image passed to server.

 

 

 

btw, registerWithJs is the last flag in constructor.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this