I want to save a chart image on my server WITHOUT using the chart context menu.
According to the documentation in order to trigger the saving it can be done by chart context menu or Javascript API, I followed the example provided on the download pack (saveExample.html) under "ExportChartSamples/ServerSide",
but there's no example how to trigger the download, I want to use a mouserollover to trigger the action but HOW? the idea is to save the chart hidden from the user (without asking anything) so I can later use that image to generate a pdf report including text an other images.
Questions:
A) According to the example provided (see point 3) is not using a javascript api? how this supposed to work without a trigger?
Now to be sure the FCExporter since the relative path should be based on the location of FCexporter.php? or is where index.php is (application root)?
C) Can I be provided with an example how to trigger the saving NOT the DOWNLOAD, again I need the saving happens without asking the user to accept just on the server side.
This is the set up I have.
1) I set up the XML document: <chart maxLabelWidthPercent="50" plotBorderThickness="4" plotBorderColor="3794d1" anchorAlpha="100" caption="" showBorder="0" bgColor="FFFFFF" exportEnabled="1" exportAtClient="0" exportAction="save" exportHandler="http://my_domain/application_folder/tchart/PHP/FCExporter.php" exportFileName="test1" >
2) Modified the FCExporter.php file to point to the saving locations and already give 777 permision to the folders and subfolders this way:
define ( "SAVE_PATH", "/pdf/capturedimages/" );
define ( "HTTP_URI", "http://my_domain/application_folder/pdf/capturedimages/" );
3) in the HTML and added : FusionCharts.js & FusionChartsExportComponent.js on the header :
function FC_Exported(objRtn){
if (objRtn.statusCode=="1"){
alert("The chart with DOM Id " + objRtn.DOMId + " was successfully saved on server. The file can be accessed from " + objRtn.fileName);
}else{
alert("The chart with DOM Id " + objRtn.DOMId + " could not be saved on server. There was an error. Description : " + objRtn.statusMessage);
}
}
and the chart starter within body:
var myChart = new FusionCharts( "tchart/radar.swf","myChartId", "620", "400", "0", "1" );
myChart.setXMLUrl("the_xml.xml");
myChart.render("chartContainer");