Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Exporting Fusion Charts to PDF

Posted on 2013-12-05
Medium Priority
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 111

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.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

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

But TCPDF cant gather the  Rendered Fusion Charts.
LVL 111

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 111

Accepted Solution

Ray Paseur earned 2000 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 111

Expert Comment

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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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…

721 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