EXPORTING MODULE
From version 2.3.5 an exporting module is available for Highcharts, which allows users to download images or PDF's of your charts. This module consists of an extra JavaScript file, exporting.js, and a web service or server module written in PHP. Highslide Software offers the exporting web service free of charge. If you include the exporting module in your charts, two buttons will appear in the upper right. One button prints the chart, which is done on the client side only. The other button handles exporting. By default, an SVG representation of the chart is sent by POST to http://export.highcharts.com, where it is converted using Apache's Batik converter to PDF, PNG or JPEG.
See the navigation and exporting reference items for a full documentation for the options available. Also see under "Methods and Properties" in the reference for members releated to exporting.
6.1 Client side setup
Add the exporting module JavaScript file after your highcharts.js file.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script src="/js/highcharts.js" type="text/javascript"></script> <script src="/js/modules/exporting.js" type="text/javascript"></script>
6.2 Server module setup
If you want to set up this web service on your own server, the
index.php
file that handles the POST is supplied in the download package inside the/exporting-server
directory.- Make sure that PHP and Java is installed on your server.
- Upload the
index.php
file from the /exporting-server directory in the download package to your server. - In your FTP program, create directory called
temp
in the same directory asindex.php
and chmod this new directory to 777 (Linux/Unix servers only). - Download Batik from http://xmlgraphics.apache.org/batik/#download. Find the binary distribution for your version of jre
- Upload
batik-rasterizer.jar
and the entirelib
directory to a location on your web server. - In the options in the top of the index.php file, set the path to batik-rasterier.jar.
- In your chart options, set the exporting.url option to match your PHP file location.
As an ASP.NET alternative to our Java/PHP based server module, Clément Agarini has kindly shared his export module for ASP.NET.
Source : http://docs.highcharts.com/
0 comments:
Posting Komentar