ashish.yanni

Save chart as Image to Server.

Recommended Posts

HI,

 

 

 

I am using FC v.3.1 and trying to implement the feature of saving the chart as image to the server side in my web application.

 

We are using apache and tomcat in combination for running or web application.

 

Using JSP to render and display the charts.

 

 

 

I can render my charts as usual using the new v 3.1 package provided.

 

Problem is when I try to save that image.

 

 

 

When I right click on the chart and try to save it to the server, it shows the capturing status on the chart.

 

After the capturing is over there is a pause of around 40-50 sec, and then I see a message in my logs.

 

 

 

INFO: error=&statusMessage=Server Directory not found.

 

 

 

I have created this directory and assigned all the permission to it.

 

In the fusioncharts_export.properties, I have given the relative path and the http path to that directory.

 

For testing purpose, I placed a sample image in that directory and tried using it thru the http path, whcih shows up correctly.

 

 

 

As u can see above there is not error message but only the status message.

 

I am not able to guess what is going wrong. I have followed the documentation on the fusioncharts site carefully for the same.

 

 

 

 

 

Any Help is appreciated. Thanks!!

Share this post


Link to post
Share on other sites

Hi Ashish,

Welcome to FusionCharts community! :)

Can you please post the properties file with all the settings you are using currently as attachment?

Can you please post the xml as attachment and also tell me the directory structure you are using?

This will help me locate the cause of the problem.

Srividya

Edited by Guest

Share this post


Link to post
Share on other sites

HI,

 

 

 

Please see the properties file attached (File Renamed).

 

I am using an apache-tomcat combination on a linux box.

 

 

 

SAVEPATH=./FusionChart_Images/ = This is a folder (event specific folder) under my application root under the apache root, .

 

 

 

Apache root : /home/insper/www/

 

Complete folder path : /home/insper/www/event/subDomain.Domain/FusionChart_Images

 

 

 

Http path : http://subDomain.Domain/FusionChart_Images/

 

 

 

Using apache redirects in httpd.conf, so the actual internal redirection to folder is :

 

 

 

http://subDomain.Domain/event/subDomain.Domain/FusionChart_Images/

 

 

 

 

 

Apache handles requests to all the files except *.jsp.

 

jsp requests are handled by tomcat.

 

 

 

I took all the JSP's from the ExprotHandler/JSP package and put it under my app root (app root directory for tomcat).

 

 

 

The chart gets rendered correctly with these settings. I added the required attributes to the chart tag while forming the xml (As mentioned in the documentation). The options for saving the chart appears on right click on the chart.

 

 

 

After I click and select the save option, the capturing status bar is seen on the chart, after some time, on the server side, I see a message saying, Server Directory not found.

FC_Properties.txt

Share this post


Link to post
Share on other sites

Hi Ashish,

Since download itself is not working, it means, it has something to do with the path to exportHandler given in the xml.

Can you please replace the FCExporter.jsp in your webapp with the one present in the attachment here and try once?

This will give better error messages.

Again, please verify the path given in exportHandler attribute.

Thanks.

Srividya :)

FCExporterWithBetterMessages.zip

Share this post


Link to post
Share on other sites

Hi Srividya ,

 

 

 

My download is working properly.but save is not working

 

its showing error message server directory does not exists.

 

what will be problem?

 

 

 

Thanks & regards

 

Rakesh

Share this post


Link to post
Share on other sites

Hi Srividya

 

 

 

Now its working fine for column2d charts but its is not working for multiaxischart.

 

actually javascript hasRendered() method is not working for multiaxis chart

 

 

 

below is my javascript function.

 

 

 

function ExportMyCharts() {

 

 

 

var chartObject1 = getChartFromId('myChartId');

 

 

 

if( chartObject1.hasRendered() )

 

chartObject1.exportChart();

 

 

 

var chartObject2 = getChartFromId('myChartId1');

 

 

 

if( chartObject2.hasRendered() )

 

chartObject2.exportChart();

 

 

 

}

 

 

 

 

 

what will be problem?

 

 

 

Thanks

 

Rakesh

Share this post


Link to post
Share on other sites

Can you please verify that registerWithJS is turned on?

Also, please check the version of swf you are using for multi series chart. You can check the version by turning on the debugMode.

Hope this helps.

Srividya

Edited by Guest

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