Solved

Exporting Fusion Charts to PDF

Posted on 2013-12-05
7
1,239 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
Comment Utility
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
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:Sevron
Comment Utility
""We have been looking at TCPDF but"
But what?"

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

Expert Comment

by:Ray Paseur
Comment Utility
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 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
Thanks for the points and thanks for using EE, ~Ray
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now