amCharts support forum

You are not logged in.

Announcement

FORUM CLOSED! This forum is closed. We moved to a new place at Zendesk. Update your bookmarks.

Flash Charts: Flash Charts Bundle


#1 2011-05-18 20:19:15

acer_amcharts
Member

Export as image

Question:
Right-click on the chart and choose "Export as image" from the menu. The chart will collect image data, and offer you to save the chart as a JPG image. 
But I do not known,How to can I  trigger with JavaScript ?

Offline

 

#2 2011-05-19 02:00:25

marcelionis
Administrator

Re: Export as image

You can trigger it by calling flashMovie.exportImage([file_name])
Check samples\flashOrJavaScript\LineAndArea\ControllingFlashWithJavaScript\ example.

Offline

 

#3 2011-05-19 02:08:23

acer_amcharts
Member

Re: Export as image

Hi :

Thank you!
How to convert image file and save in my directory?

Acer

Offline

 

#4 2011-05-19 05:20:49

marcelionis
Administrator

Re: Export as image

There is export.php file in amcharts/flash folder. You can change image format there, this line: $imgtype = 'jpeg';
Could you explain where do you want to save the image - on a server or in user's computer?

Offline

 

#5 2011-05-19 21:07:35

acer_amcharts
Member

Re: Export as image

Hi

Thank you for your help!

Please ask a question,
I will create 6000 figure files.
The files are saved the  directory of the web server server.

My method:
Calls function (flashMovie.exportImage ('../../ amradar / export.aspx ');), to produced 6000 figure files.

I encountered problems:
The system will pop-up window, asking me to press save or cancel

Are there any other way to solve?

Thank you!

Acer

Offline

 

#6 2011-05-20 02:46:31

marcelionis
Administrator

Re: Export as image

Check this topic, there is a solution in last post: http://www.amcharts.com/forum/viewtopic.php?id=509

Offline

 

#7 2011-05-21 01:21:48

acer_amcharts
Member

Re: Export as image

Hi Administator:

Great! thank.

I do not know how to save the generated image file on the server hard drive without user intervention.
I mean the image file to be automatically saved without user to be prompted where he wants to save the file.
I mean, How to modify the "export.aspx.cs" .

Thank you!

Acer

Offline

 

#8 2011-05-22 22:51:28

acer_amcharts
Member

Re: Export as image

Is OK! Thank your!

Ans:
Modify the export.aspx.cs
//step 1
//Cancel this line
Response.AddHeader("Content-Disposition", "attachment; filename=\"amchart.jpg\"");

//step 2
//server c disk
result.Save("c:\\YourImage.jpeg", img_encoder, enc_params);

Offline

 

© amCharts | Forum engine: PunBB