Exporting Fusion Charts to PDF

Posted on 2013-12-05
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
Question by:Sevron
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2

Expert Comment

ID: 39698004
Here is another option,  It does both image and pdf.

Author Comment

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.
LVL 110

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.
Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.


Author Comment

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

But TCPDF cant gather the  Rendered Fusion Charts.
LVL 110

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.
LVL 110

Accepted Solution

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.
LVL 110

Expert Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP MYSQLI Connection in Function in a class 4 29
Copy files and run psex to windows 7 only 14 51
Drag & Drop Error 5 32
run powershell script endlessly 3 32
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

738 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