Sign in to follow this  
Pallav

Export multiple charts

Recommended Posts

Hi,

 

 

 

i want to export images from two charts within the same page. To do so, i'm using the saveAsImage() JS Function on both charts from an onClick button event. I'm also using the FusionChartsSave.aspx page from your samples to create the images.

 

 

 

 

< asp : Button ID="Button2" runat="server" Text="Save Report" OnClientClick="saveChart()" / >

 

 

 

 

 

function saveChart()

 

{

 

//Get chart from its ID

 

var chartToPrint = getChartFromId('chart1');

 

chartToPrint.saveAsImage();

 

chartToPrint = getChartFromId('chart2');

 

chartToPrint.saveAsImage();

 

}

 

 

 

 

It's working quite well, i'm getting both prompts for image downloads but sometimes i'm only getting the first image and not the second (when the time between the two request is too long, i think)

 

 

 

Is there a better way to achieve this ?

 

Thanks

Share this post


Link to post
Share on other sites

What I feel is that both images are getting generated properly, but because of download dialog being forced at the same time, only of them is displayed. You can configure your ASP.NET script to cache all images for a session (if feasible), zip it and provide as a single download.

Share this post


Link to post
Share on other sites

I just want to ensure that do you have chartToPrint.saveAsImage() function in your FusionCharts.js. If yes, Can you please send only that FusionCharts.js at [email protected]. Or If can send me the code of only chartToPrint.saveAsImage() function .It would be very very beneficial to me.

 

 

 

 

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Hi,

My requirement is to create a pdf file out of those images generated using saveasImage?.

I am using the eval version on PHP Windows,I have modified the ImageSaving.php to create a file on the server itself.

But I have around 5 charts loaded on the same page and would all of them to be created on the server. On the first submit control moves to the php page and quits.

Can someone help me in achieving this.

Thanks, Guna

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