Sign in to follow this  
chanda shirisha

Exporting Chart error server directory does not exist

Recommended Posts

Hi,

 

I am using php fusion charts to save charts to my server disk to use it inside my php pdf report generation. While saving as image giving error like Server directory does not exist. 

 

I followed all the steps what is mentioned in documentation and given correct path of my directory inside export handler index.php, then also showing me the same error.

 

Please help me to get out of this.

Edited by chanda shirisha

Share this post


Link to post
Share on other sites

Hi,

 

I am using php fusion charts to save charts to my server disk to use it inside my php pdf report generation. While saving as image giving error like Server directory does not exist. 

 

I followed all the steps what is mentioned in documentation and given correct path of my directory inside export handler index.php, then also showing me the same error.

 

Please help me to get out of this.

Hi,

 

Could you please confirm the FusionCharts version you are using?

 

In case it is the latest version, i.e, FusionCharts v3.4, please note that currently, the charts can only be exported using the hosted FusionCharts Suite XT Export handler service. We intend to ship a self-hosted Export Handler module next quarter.

Ref.- http://docs.fusioncharts.com/tutorial-getting-started-adding-interactivity-exporting-to-images-or-pdf.html

 

If you are using a previous version, please send us a scaled-down sample or the error that you are receiving.

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Hi,
 
Thanks for your quick reply.
 
Currently i am using v3.3.1 - Service Release 3 verison (Trial Version).
 
Down I am attaching my sample code and output image, and inside ExportHandler/PHP/index.php am defining below lines to  save charts into my server directory route.

 

define("SAVE_PATH", "./uploads/");

 

define("HTTP_URI", "http://emergingcitiez.com/uploads/");

 

 

chart.png

<script type="text/javascript" src="/js/fusioncharts/FusionCharts.js"></script>
<script type="text/javascript">
 //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);
 }
 }
 </script> 
<?php
include('/js/fusioncharts/FusionCharts.php');
$strxml='<chart exportAtClient="0" exportAction="save" ExportHandler="http://emergingcitiez.com/js/fusioncharts/ExportHandlers/PHP/index.php" exportEnabled="1" caption="Half Yearly Revenue Analysis" yaxisname="Revenue" numberprefix="$" yaxismaxvalue="250000" showborder="0" theme="fint">
<set label="Jul" value="150000" tooltext="Occupancy: 67%{br}Revenue:$150k{br}3 conferences hosted!" />
<set label="Aug" value="130000" tooltext="Occupancy: 64%{br}Revenue:$130k{br}Lean summer period!" />
<set label="Sep" tooltext="Occupancy: 44%{br}Revenue: $80k{br}Reason: Renovating the Lobby" value="95000" />
<set label="Oct" value="170000" tooltext="Occupancy: 73%{br}Revenue:$170k{br}Anniversary Discount: 25%" />
<set label="Nov" value="155000" tooltext="Occupancy: 70%{br}Revenue:$155k{br}2 conferences cancelled!" />
<set label="Dec" value="230000" tooltext="Occupancy: 95%{br}Revenue:$230k{br}Crossed last year record!" />
</chart>';
echo renderChart('/js/fusioncharts/Column2D.swf', '', $strxml, 'linearguage1', '400', '400', false, true);
?>

Share this post


Link to post
Share on other sites

 

Hi,

 

Thanks for your quick reply.

 

Currently i am using v3.3.1 - Service Release 3 verison (Trial Version).

 

Down I am attaching my sample code and output image, and inside ExportHandler/PHP/index.php am defining below lines to  save charts into my server directory route.

 

define("SAVE_PATH", "./uploads/");

 

define("HTTP_URI", "http://emergingcitiez.com/uploads/");

 

 

chart.png

<script type="text/javascript" src="/js/fusioncharts/FusionCharts.js"></script>
<script type="text/javascript">
 //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);
 }
 }
 </script> 
<?php
include('/js/fusioncharts/FusionCharts.php');
$strxml='<chart exportAtClient="0" exportAction="save" ExportHandler="http://emergingcitiez.com/js/fusioncharts/ExportHandlers/PHP/index.php" exportEnabled="1" caption="Half Yearly Revenue Analysis" yaxisname="Revenue" numberprefix="$" yaxismaxvalue="250000" showborder="0" theme="fint">
<set label="Jul" value="150000" tooltext="Occupancy: 67%{br}Revenue:$150k{br}3 conferences hosted!" />
<set label="Aug" value="130000" tooltext="Occupancy: 64%{br}Revenue:$130k{br}Lean summer period!" />
<set label="Sep" tooltext="Occupancy: 44%{br}Revenue: $80k{br}Reason: Renovating the Lobby" value="95000" />
<set label="Oct" value="170000" tooltext="Occupancy: 73%{br}Revenue:$170k{br}Anniversary Discount: 25%" />
<set label="Nov" value="155000" tooltext="Occupancy: 70%{br}Revenue:$155k{br}2 conferences cancelled!" />
<set label="Dec" value="230000" tooltext="Occupancy: 95%{br}Revenue:$230k{br}Crossed last year record!" />
</chart>';
echo renderChart('/js/fusioncharts/Column2D.swf', '', $strxml, 'linearguage1', '400', '400', false, true);
?>

Hi,

 

It seems like the folder where you are willing to save the exported image of the chart, does not exists, hence, it is throwing the error,

 

Also, we would suggest you to upgrade your current version to the latest to resolve these issues, as we are not working any further on the previous version.

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for your response.

 

I tried to download the fusioncharts latest trial version, but its not giving me the complete code for all charts like previously it has given.

 

Please let me know how to upgrade to the latest version.

Share this post


Link to post
Share on other sites

Hi,

 

The latest downloadable version of FusionCharts contains only the required JavaScript library files to be used to render charts. Since Flash charts has been deprecated, the folder structure has been modified. 

 

Thanks.

Share this post


Link to post
Share on other sites

Hi,

 

I updated to the latest 3.4 version of the fusion charts. But am unable to find the documentation for server side exporting of charts. 

 

Please help me to export charts into server side directory with latest version.

 

Thanks.

Share this post


Link to post
Share on other sites

Hi,

 

I updated to the latest 3.4 version of the fusion charts. But am unable to find the documentation for server side exporting of charts. 

 

Please help me to export charts into server side directory with latest version.

 

Thanks.

Hi,

 

Please note that the latest version, i.e, FusionCharts v3.4 supports pure JavaScript charts and hence, server-side export is only possible.
 
But currently, the charts can only be exported using the hosted FusionCharts Suite XT Export handler service. We intend to ship a self-hosted Export Handler module next quarter.
 
Hope this helps. :)

Share this post


Link to post
Share on other sites

Hi,

 

I am updated my PHP application with latest fusioncharts trial version 3.5. I am trying to export my javascript charts as png images to server directory. 

 

How to export multiple charts as images to server directory on single button click.

Share this post


Link to post
Share on other sites

Hi,

 

Please note that starting version 3.4.0, all charts are rendered as pure JavaScript charts and hence batch export or export of multiple charts at a time is not supported. Though you can use of PhantomJS for printing multiple charts.

 

 
PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards.
Steps to follow to save the images of the chart without rendering in
the browser using PhantomJS:
 (1)Download the PhantomJS from http://phantomjs.org/download.html(choose your Operating System)
 (2)Extract the files into your application folder along with the other FusionCharts JavaScript files.
 (3)Copy savePDF.js attached along with this mail within the same folder.
 

 Now, to execute from a command line: phantomjs savePDF.js [--delay ]
 [--scale ] TheURLOfAnyDashboard outputFileName
 

 Please refer for more information at:
http://blog.fusioncharts.com/2013/03/how-to-save-charts-as-images-at-server-side/

 

 

Hope this helps.

 

 

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