Sign in to follow this  
mssjdb

How To Save More Charts On Server With Single Button

Recommended Posts

Hi,

 

I am trying to save graphs on server side. i was succeeded up to save one graph. but i am unable to save more graphs. how it can be ?

 

 

my code is

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- FusionCharts Core JavaScript Object -->
<script type="text/javascript" src="FusionCharts/FusionCharts.js"></script>

<script type="text/javascript">
var totalCharts = 2;


function exportCharts(exportType)
{

for( var i = 0; i < totalCharts; i++ ) {
var num = i+1;
var id = "chart"+num+"Id";
exportchart(exportType,id);


alert(id);

}
}

function exportchart(exportType,id)
{
var chart = FusionCharts(id);

// Now, we proceed with exporting only if chart has finished rendering.
if (chart.hasRendered() != true)
{
	alert("Please wait for the chart to finish rendering, before you can invoke exporting");
	return;
}

// call exporting function
chart.exportChart( {exportFormat: exportType} );


}

</script>
</head>

<body>

     <p align="center">
       <input type="button" class="button" value="Export as PNG" onclick="exportCharts('PNG')" id="exportButtonPNG" />
     </p>

   <div >
     <div id="average" style="text-align:center">Loading Chart... </div>
   <div id="serverSideChart" style="text-align:center">Loading Chart... </div>
     </div>





 <script type="text/javascript" >

// Render the chart (See documentation for explanation of the codes below)
//echo renderChart("FusionCharts/MSColumn3D.swf", "", $strXML3, "average", 1100, 350);
var chart2 = new FusionCharts("FusionCharts/MSColumn3D.swf", "chart1Id", "600", "400", "0", "1");		   			
chart2.setXMLUrl("average.xml");
chart2.render("average");
var chart1 = new FusionCharts("FusionCharts/MSColumn3D.swf", "chart2Id", "600", "400", "0", "1");		   			
chart1.setXMLUrl("overall.xml");
chart1.render("serverSideChart");

 </script>

<!-- Google Analytics Tracker Code Starts -->
<script type="text/javascript">
// analytics
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost 
+ "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
if (typeof(_gat) == "object") {
var pageTracker = _gat._getTracker("UA-215295-3"); pageTracker._initData(); pageTracker._trackPageview();
}
</script>

</body>
</html>

 

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

It seems the code is correct and is working fine from our end and successfully exported two Flash chart images to server using latest FusionCharts XT V3.3.0 Evaluation files.

 

Could you please confirm the FusionCharts XT version which is being used at your end?

 

Also, please confirm whether you are exporting Flash/JavaScript charts image to server.

 

Awaiting 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