Sign in to follow this  
Lana

Problem Exporting Chart As Image

Recommended Posts

Hello,

 

I have JSP pages that get XMLString dynamically from the back end java classes that load the data for the charts from the DB, and generate XML on-the-fly. The chart itself is not loaded in the main page, but in in the div that is loaded with ajax after all the data for the chart is received from DB. The chart data is refreshed every 3 minutes.

 

What happens most of the times (sometimes the image is saved properly for some charts) when I try to save as JPG (or other save options) is the following:

 

 

1 - Capturing Data goes to 100%

2 - I get a file Download dialog for saving an HTML file. The filename is always FCExporter(somtimes +SomeRandomNumber).htm

3 - If I click open on the dialog, this URL opens: http://localhost:8080/Pulse/FCExporter

4 - Here is what is displayed in the browser:

 

statusMessage= Width/height not provided. Insufficient data.Background Color not specified. Taking White (FFFFFF) as default background color.

statusCode=0

width=0

height=0

DOMId=null

Here is an example of the JSP div that gets loaded after the data is received from back-end and injected into the XML:

 

 <%!String regionXMLDataString;%>
<%regionXMLDataString = (new RegionPieChartDataBuilder()).getChartXML(request.getParameter("transactionID"));%> 
...
<fc:render chartId="RegionPie"
swfFilename="Charts/FusionCharts/Pie2D.swf" width="350
height="300" debugMode="false" registerWithJS="true"
xmlData="<%= regionXMLDataString %>" 
...

 

Here is the XML example for the chart:

 

<chart caption='Failure Rate by Region' exportEnabled='1' exportHandler='FCExporter' >
<set color='5BAD5B' label='N East' value='0'/>
<set color='B00000' label='West' value='5'/>
<set color='57517B' label='East' value='8'/>
</chart>

 

And here is my properties configuration:

SAVEPATH=./images/charts/
HTTP_URI=http://localhost:8080/Pulse/images/charts/

 

web.xml:

   <servlet>
    <display-name>FCExporter</display-name>
    <servlet-name>FCExporter</servlet-name>
    <servlet-class>com.fusioncharts.exporter.servlet.FCExporter</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>FCExporter</servlet-name>
    <url-pattern>/FCExporter</url-pattern>
 </servlet-mapping>

 

And I have the fcexporthandler.jar and fcexporter.jar in my lib folder.

 

Also, here is what I am getting in the system log file:

Mar 1, 2012 6:23:52 PM com.fusioncharts.exporter.error.ErrorHandler buildResponse
INFO: Notices
Mar 1, 2012 6:23:52 PM com.fusioncharts.exporter.error.ErrorHandler buildResponse
INFO: Miscellaneous Messages=<BR>width=0<BR>height=0<BR>DOMId=null

 

Thanks in advance for your help.

Edited by Lana

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

We are looking into it.

 

We will update you on this very soon.

 

Thanks for your time .

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

Thank you for the post.

 

I do not see anything wrong with your code.

 

Please find attached a sample demo code, see if this helps !

 

Also, for more details on 'Exporting Charts as PDF or Images', please refer to the link below,

http://docs.fusioncharts.com/charts/contents/?exporting-image/ECOverview.html

 

See section "Exporting as Image/PDF".

 

Hope this helps !

FinalProjectDemoForExport.zip

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