Highcharts - Exporting Module

前端 未结 2 860
梦谈多话
梦谈多话 2021-02-13 22:03

I am using highcharts to generate graphical data pulled from a database.

I am having trouble using the exporting module. I have included the exporting property:

相关标签:
2条回答
  • 2021-02-13 23:02

    Which version of Highcharts you are using? Which version of jQuery?

    Currently is the v2.1.6, I recommend you use the latest release because they are continuously fixing bugs, adding new functionality, etc.

    Prior to v2.0 there is no support to the exporting feature

    The only things you need to do in order to bring the exporting module working are:

    1- First: Add the js script after the highcharts script, like this:

        ...
        <script type="text/javascript" src="../js/highcharts.js"></script>
        <!-- 1b) Optional: the exporting module -->
        <script type="text/javascript" src="../js/modules/exporting.js"></script>
        ...
    

    The exporting module is enabled by default, so there is no need to have the code you posted, so you can remove it:

    exporting{
      enabled:true
    }
    

    2- Second: Be sure to publish the exporting-server/index.php file correctly.

    Here you have what the official documentation reads about the exporting module installation:

    1. Exporting module

    From version 2.0 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.

    Here you can see the configuration options regarding the exporting module: http://www.highcharts.com/ref/#exporting

    Hope it helps you.

    0 讨论(0)
  • 2021-02-13 23:05

    Make sure the script tag has

    type="text/javascript"

    0 讨论(0)
提交回复
热议问题