Sign in to follow this  
jp_sa

Export To Image With Button

Recommended Posts

Good day Fusion

 

I have a strange issue. I am able to export a chart to an image via the context menu only and not by a button calling the following javascript:

 

<script type="text/javascript" language="JavaScript">

function exportCharts(exportType) {

 

//Get reference to chart.

var chart = FusionCharts("myChartId");

 

// Now, we proceed with exporting only if chart has finished rendering.

// if (chart.hasRendered && chart.hasRendered()) {

// call exporting function

// alert('Exporting...');

chart.exportChart({ exportFormat: exportType });

alert('exporting');

//alert("Please wait for the chart to finish rendering, before you can invoke exporting");

// return;

//

// }

}

 

function exportedToServer(objRtn)

{

if (objRtn.statusCode=="1"){

alert("The chart was successfully saved on server. The file can be accessed from " + objRtn.fileName);

}else{

alert("The chart could not be saved on server. There was an error. Description : " + objRtn.statusMessage);

}

}

</script>

 

I am using v3.1 charts and suspect that the javascript example may not be compatible with the javascript routine.

 

Please can you shed some light on this matter?

 

JP

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

Welcome to FusionCharts Forum! smile.gif

Could you please confirm whether you are rendering the chart from local file system or not?

Due Adobe Flash Player's default security system, the JavaScript method does not work from local filesystem. It only works when hosted on a server (localhost or remote) unless configured otherwise.

Awaiting for your response.

Share this post


Link to post
Share on other sites

Good day

 

 

I have changed those settings and it now works! Thank you very much for your help!

 

JP

 

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

Could you please confirm whether you are rendering the chart from local file system or not?

 

Due Adobe Flash Player's default security system, the JavaScript method does not work from local filesystem. It only works when hosted on a server (localhost or remote) unless configured otherwise.

 

Awaiting for your response.

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