Export your charts as images or PDFs

How often does this happen to you – you create a stunning information-intensive chart after a lot of hard work for your web page and then intend to embed the same in your annual report? Or mail it to one of your colleagues? But since you have no easy way to export the chart from the web page, you have to create the chart all over again.

What if all of that could be done as simply as in the screenshot below?

SAI_SaveAsImage

Yes, with FusionCharts Suite XT, you can do it with one single click.

Any chart in FusionCharts v3.1 can be configured to be exported as an image (JPEG or PNG) or a PDF file by the end user. This can be done either on the server-side or on the client-side. Before we get into slightly technical details of the same, here’s a live demo of the same that you might want to see to get a better grasp of things.

Now, FusionCharts by itself cannot directly export the charts as images. It needs help either from server-side scripts, or other client side Flash movies (coded in Flash 10) to accept the bitmap snapshot sent by FusionCharts, and to convert that into an image or PDF. These are called FusionCharts Export Handlers.

The export handlers come in 2 flavors: Server-side Handlers & Client-side Handlers. Let’s look into each of them in details.

Server-side Export Handlers

The server-side export handlers help you export FusionCharts as images/PDF with the help of scripts that are placed on your servers. We provide ready-to-use scripts for ASP.NET, PHP (uses GD and GZIP library), Ruby on Rails (uses RMagick and zlib) and Java in our Download pack itself.

These scripts accept compressed bitmap data from FusionCharts (over HTTP or HTTPS) and convert the same into images/PDFs. Post conversion, you’ve two options:

  • Save the generated output (image/PDF) on the server’s disk. This allows you to use these images later for embedding in your emails/reports.
  • Or, send it back to the browser so that your user can download it.

Client-side Export Handlers

The client-side FusionCharts Export Component, as the name suggests, helps you bypass all server scripts and save the charts as images/PDFs at the client side itself. You would typically use client-side export when your server doesn’t support any of the technologies mentioned in server-side exporting or you don’t want to transfer data between your client and server (which in turn will make the export process faster).

Client-side exporting is done using FusionCharts Export Component SWF file (which is coded in Flash 10) and FusionCharts Export Javascript class, both of which are available in the Download pack.

In both client and server side exports, you can configure the output formats(PDF/JPEG/PNG) that you wish to make available from your context menu and the cosmetics of the export dialog box itself. You can also make your own custom export panels (with custom buttons, look & feel) somewhere near the chart in a <DIV> and then connect the same to the export handlers of the charts.

Batch Export

Let’s say you have multiple charts on a page and you want to export all of them with a single click. In comes batch export. You can make use of batch export when you are exporting charts on the client-side. The exported files for each chart can either be saved individually, or all the exported charts can be saved as a single file:

ECBatchSetup1

Batch Export can thus be made use of extensively in reporting purposes and dashboards, where the user can save any chart and use it later in reports/emails.

To get details on how to implement either server or client side (including Batch export) exporting for your charts, please check out the Exporting as Image/PDF section in our online documentation.

In this post, we talked about the feature in FusionCharts v3.1 specifically, but it applies equally well to FusionWidgets, FusionMaps and PowerCharts v3.1 as well.

With this blog post, we start our promised series of an in-depth look at the new features of v3.1. Once you know the features inside out, you can use them to render a powerful charting experience. So keep coming back for more…

  • Michael Schurter (schmichael) May 7, 2009, 10:10 pm

    Python users can grab server-side export code here:
    https://bitbucket.org/schmichael/python-fusioncharts/
    There’s code for Django and a custom CherryPy based Python web framework.
    The client-side export code doesn’t work for me in Ubuntu 9.04.

  • Jason June 18, 2009, 11:34 am

    Hello,
    is it possible in Fusionchart-Free to export in PDF or just for V3-1

  • Sudipto Choudhury July 4, 2009, 5:14 am

    Hi Jason,
    I am afraid, export to PDF (or any other export feature) is not available in FusionCharts Free.
    You need to use FusionCharts v3.1 or above to avail the Export to JOG/PNG/PDF feature.

  • Shanmukha August 31, 2009, 7:53 am

    While saving as images at server-side, I am getting applet alerts. Hoe to disable these alerts??

  • parxier November 9, 2009, 4:19 am

    Sudipto,
    You should fix this page:
    http://www.fusioncharts.com/free/docs/Contents/v3vsFree.html
    It says:
    Export Chart as Image/PDF
    FusionCharts v3: No
    FusionCharts Free: Server-side and client-side export to JPG, PNG and PDF
    I believe it’s other way around. I wish it is the way it says it is! 🙂

  • Sanket (FusionCharts Team) November 20, 2009, 7:31 am

    @Parxier: Done. Thanks a lot for pointing it out. And sorry we could not grant your wishes here 🙂

  • Ranc2 February 8, 2010, 8:15 pm

    Hi,
    Would I need batch export in order to export the chart and its grid on the same file ?
    If so, am I obliged to user client-side export ?
    I’ve already implemented chart server-side export, and it works fine, until I found out the chart legend (namely the grid) is not found on the exported pdf.
    Thanks

  • Sanket (FusionCharts Team) February 9, 2010, 5:49 pm

    @Ranc2: I am afraid grid does not support export feature. As of now batch export is supported at client side until and unless you take some time to modify the export handler code to reopen existing exported image/PDF file (at server) and keep on appending the new images to it.

  • Marcelo February 24, 2010, 2:04 pm

    Hi,
    About batch export. Is there a way to generate the graphs on the server-side by a periodic process started on the server by a timer to send them?

  • Ankit Agarwal May 14, 2010, 5:52 am

    Hi,
    Any one know how to export the scroll charts in jpg
    waiting for reply

  • Sanket (FusionCharts Team) May 17, 2010, 9:10 am

    @Ankit: We have a thread in our forum on the same topic – http://www.fusioncharts.com/forum/Topic26277-31-1.aspx

  • Meghana June 8, 2010, 10:45 am

    if v click export n click on other tab it wont get camptured in mozilla

  • Johny July 9, 2010, 5:31 pm

    How to find out the version of the fusion chart in use.

  • Sanket (FusionCharts Team) July 14, 2010, 10:30 pm

    @Johny: Use the debug window to find out the version – http://www.fusioncharts.com/docs/Contents/Debug/Window.html

  • izzy July 23, 2010, 8:33 am

    Hi,
    The version of my fusion chart is 3.0.6.
    am I able to do a server-side export?
    Thanks.

  • Sanket (FusionCharts Team) July 26, 2010, 2:09 pm

    @izzy: Nope, but you can upgrade to v3.1 and use server-side export.

  • MaK September 17, 2010, 12:58 pm

    Exporting the scrollable charts in full has come in to picture now or still in cards.
    If this functionality is available now, do me a favour by sending the link where I can find more about that particular feature.
    Thanks in advance.

  • Michael Mofokeng June 27, 2011, 7:23 pm

    Is it possible to export charts using fusion charts free?

  • Neil Marks October 30, 2012, 9:22 pm

    Are there any options available for adjusting the quality of the images created via the export process?

    • Swarnam November 5, 2012, 10:38 pm

      No. We do not have any options available for improving the quality of the exported charts. Currently images rendered by FusionCharts Export Handler exports is 72 DPI.

  • kasireddi yernieswararo January 8, 2013, 10:08 am

    Hi,
      I am exporting fusion charts by saving in some [available ex: pdf ] format . Even though i disabled some graphs of chart by using legend after exporting i am getting the full chart.

    How to export the chart with some of the graphs disabled.i.e by using legends.??
    Please help me.

    Thanks,
    –kasiredd. 

    • Swarnam January 23, 2013, 10:38 am

      Hi,

      It is possible to export the current state of the chart rendered both in Flash/JavaScript mode.

      Please Note: Starting FusionCharts XT SR5, JavaScript charts can export the current state of the charts.

      If the issue is not resolved, please send us the sample code to “support@fusioncharts.com”

  • Aneesh April 17, 2013, 8:21 pm

    I have 6 charts rendered in a page. I am calling exportChart function on click of a button. The charts start capturing images only if it is visible. So every time I need to scroll down to save the below charts. What would be the reason. I am stuck with this. Waiting for a reply

  • Swarnam April 18, 2013, 1:02 pm

    Hi Aneesh,
     
    Since Flash charts depend on the Flash player, the charts has to be rendered in the viewable area for exporting. To render the charts in the non view-able area, we have created workaround.
    “scroll.js” has been created internally which helps you to render the charts in non-viewable area and helps in Batch Exporting of all the charts.
    If you require the same, please drop a mail to <support@fusioncharts.com>.

  • ernie May 5, 2015, 6:11 pm

    Does the export function work on a windows web server?

  • Srinivas Patlolla July 3, 2015, 5:48 pm

    Hi,
    How to export the multiple charts at a time and some of them are not visible in screen ( Those will visible if we scroll down )

Leave a Comment