How to save an image of the chart on the server with highcharts?

前端 未结 4 1964
一向
一向 2020-11-29 03:04

With highcharts, you have a built-in button to download the current chart (example: http://www.highcharts.com/demo/, this button:

4条回答
  •  自闭症患者
    2020-11-29 03:45

    I haven't done that before, but I believe you want to play with the index.php file located in the exporting-server folder. By default Highcharts provides (for free) a web service but you can modify that and create your own web service for exporting, or do whatever you want with the chart. Look at these instructions which can be found here Export module:

    "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.

    1. Make sure that PHP and Java is installed on your server.
    2. Upload the index.php file from the /exporting-server directory in the download package to your server.
    3. In your FTP program, create directory called temp in the same directory as index.php and chmod this new directory to 777 (Linux/Unix servers only).
    4. Download Batik from http://xmlgraphics.apache.org/batik/#download. Find the binary distribution for your version of jre
    5. Upload batik-rasterizer.jar and the entire lib 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.
    6. In your chart options, set the exporting.url option to match your PHP file location. "

提交回复
热议问题