Solved

Exporting Fusion Charts to PDF

Posted on 2013-12-05
7
1,279 Views
Last Modified: 2013-12-11
Hi we have a reports area of our system which enables the user to view charts for different area and locations.

We now need to export all the charts which are currently being viewed to a PDF or as an image. We are using Fusion Charts, and using the javascript method with XML files to create the charts (so not the flash method to generate the charts). The attached image is an example of what our system looks like for the reports area.  

The user can search using the form at the top and then the reports are shown with the appropriate data for the chosen area at the bottom.

We have been looking at TCPDF but
Our-system.png
0
Comment
Question by:Sevron
  • 4
  • 2
7 Comments
 
LVL 9

Expert Comment

by:BlueYonder
ID: 39698004
Here is another option, http://blog.fusioncharts.com/2009/05/export-your-charts-as-images-or-pdfs/.  It does both image and pdf.
0
 

Author Comment

by:Sevron
ID: 39698025
Hi thanks for the reply, we looked at this but when you look at it in more depth it requires the server setting up with additional open source software, and other tweaks we would like to avoid that as the server currently hosts several of our products.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39698183
We have been looking at TCPDF but
But what?  In my experience the two "mainstream" PHP libraries are FPDF and TCPDF.  Have a look at the question over here for a couple of examples of the "hello world" exercises using these class libraries.

The largest challenge you may face arises from the way Fusion Charts uses the client-server model.  Your data is built on the server, then sent to the JavaScript client in XML format, where the chart rendering takes place under control of the web browser.  If you want to create a PDF, however, the entire process lives on the server.  What this means, in a nutshell, is that you lose the chart rendering of JavaScript and you're back to just having the XML document.  You can't export the charts to PDF; the data has already been exported before the chart is rendered, and you can't readily get it back from the browser.  There are some Windows-only capabilities in PHP that might be useful, but I've never heard a satisfactory success story.

I often see questions that go something like, "How can I convert my web page to PDF," and there really is not any good answer for a question like that.  These two things are "fish and fowl," both consumables but not at all alike.  A more successful path is usually found when the question is "How can I render the data that is currently shown on my web page, but on paper, in the form of a PDF?"  That leads you in the direction of the server-side technologies that can be made to work well.

You might consider JpGraph.  It can build the server-side image files you need.  You might also consider doing a bit of your own rendering using the PHP image manipulation functions.  It looks like it is unsupported, but FCImg might be useful.  I have never tried it, but it sounds promising.  It's a bit of a Rube Goldberg design with a lot of moving parts and it would probably be a release-maintenance headache, but it might be worth a test drive.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:Sevron
ID: 39698208
""We have been looking at TCPDF but"
But what?"

But TCPDF cant gather the  Rendered Fusion Charts.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39698225
If you want the rendered Fusion Charts and you're not able to accept anything else, you're putting a big risk into the project.  I understand that may be necessary.  I would look at FCImg.  But I would also have the nagging doubt that it's kind like chemotherapy.  It might work, but only if accompanied by prayer and good luck.  And it might not.  

If this were my project, I would start by setting up a group of qualification tests that could show you, quickly, whether FCImg was a good solution.
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39698258
Interesting observation, in the form of a "heads up."  Go to the FCImg page, scroll down and click the link in the left sidebar that says, "3DChart_Col_3."  Take note of the error in rendering the "degree" symbol.  It looks to me like the Fusion Charts render the text in UFT-8, but the browser is assuming ISO-8859-1 or similar.  You may want to be on the lookout for character-code collisions.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39711628
Thanks for the points and thanks for using EE, ~Ray
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question