james555

Charts show up find on screen but won't save server-side

Recommended Posts

Like I said, it saves to the server if I right click and save as.... but won't do it server-side. I'm a bit unclear on why I have to have an xml file on the server to render using the javascript example. Can't I stream it like I do with the renderChart function?

 

 

 

Here is the render code I'm using:

 

 

 

Trying both:

 

 

$strXML = "";

 

//Convert data to XML and append

 

foreach ($final as $arSubData)

 

$strXML .= "";

 

//close element

 

$strXML .= "";

 

 

 

//echo $strXML;

 

 

 

//Create the chart - Column 3D Chart with data contained in strXML

 

echo renderChart("FusionCharts/Column3D.swf", "", $strXML, "productSales", 600, 300, false, false);

 

 

 

?>

 

The chart will appear within this DIV. This text will be replaced by the chart.

 

 

//Create the chart. Make sure registerWithJS is set to 1, else callback cannot happen.

 

var myChart = new FusionCharts("FusionCharts/Column3D.swf", "test", "myChartId", "600", "300", "0", "1");

 

myChart.setDataURL("http://myurl/tmp/chart.xml");

 

myChart.render("chartdiv");

 

 

 

 

 

and here's the javascript:

 

 

include("FusionCharts/FusionCharts.php");

 

?>

 

 

 

//Callback handler method which is invoked after the chart has saved image on server.

 

function FC_Exported(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);

 

}

 

}

 

 

 

both charts come up fine... although I don't like js version where I have to specifiy an xml file on the server ???

 

 

 

So I see both charts but why doesn't javascript kick in to write the file to the server? Or is there a better way with PHP?

 

 

 

I'm testing the trial version and really want to buy but this is bad if I can't easily save to the server like other chart components. Please advise.

Edited by Guest

Share this post


Link to post
Share on other sites

FYI I purchased the paid version and still now luck... any ideas? and do you have to save an XML file on the server or can I stream it within the php app and simply save the resulting jpg on the server?

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