Class Exporting

    • Constructor Detail

      • Exporting

        public Exporting()
      • Exporting

        public Exporting​(Boolean enabled)
    • Method Detail

      • setAllowHTML

        public void setAllowHTML​(Boolean allowHTML)

        Experimental setting to allow HTML inside the chart (added through the useHTML options), directly in the exported image. This allows you to preserve complicated HTML structures like tables or bi-directional text in exported charts.

        Disclaimer: The HTML is rendered in a foreignObject tag in the generated SVG. The official export server is based on PhantomJS, which supports this, but other SVG clients, like Batik, does not support it. This also applies to downloaded SVG that you want to open in a desktop client.

        Defaults to: false

      • setButtons

        public void setButtons​(Buttons buttons)
        Options for the export related buttons, print and export. In addition to the default buttons listed here, custom buttons can be added. See navigation.buttonOptions for general options.
      • setEnabled

        public void setEnabled​(Boolean enabled)
        Whether to enable the exporting module. Disabling the module will hide the context button, but API methods will still be available.

        Defaults to: true

      • getError

        public String getError()
      • setError

        public void setError​(String _fn_error)
      • setFallbackToExportServer

        public void setFallbackToExportServer​(Boolean fallbackToExportServer)
        Whether or not to fall back to the export server if the offline-exporting module is unable to export the chart on the client side.

        Defaults to: true

      • setFilename

        public void setFilename​(String filename)
        The filename, without extension, to use for the exported chart.

        Defaults to: chart

      • setLibURL

        public void setLibURL​(String libURL)
        Path where Highcharts will look for export module dependencies to load on demand if they don't already exist on window. Should currently point to location of CanVG library, RGBColor.js, jsPDF and svg2pdf.js, required for client side export in certain browsers.

        Defaults to: https://code.highcharts.com/{version}/lib

      • setMenuItemDefinitions

        public void setMenuItemDefinitions​(Map<String,​ExportingMenuItemDefinition> menuItemDefinitions)

        An object consisting of definitions for the menu items in the context menu. Each key value pair has a key that is referenced in the menuItems setting, and a value, which is an object with the following properties:

        onclick
        The click handler for the menu item
        text
        The text for the menu item
        textKey
        If internationalization is required, the key to a language string
      • setPrintMaxWidth

        public void setPrintMaxWidth​(Number printMaxWidth)
        When printing the chart from the menu item in the burger menu, if the on-screen chart exceeds this width, it is resized. After printing or cancelled, it is restored. The default width makes the chart fit into typical paper format. Note that this does not affect the chart when printing the web page as a whole.

        Defaults to: 780

      • setScale

        public void setScale​(Number scale)
        Defines the scale or zoom factor for the exported image compared to the on-screen display. While for instance a 600px wide chart may look good on a website, it will look bad in print. The default scale of 2 makes this chart export to a 1200px PNG or JPG.

        Defaults to: 2

      • setSourceHeight

        public void setSourceHeight​(Number sourceHeight)
        Analogous to sourceWidth
      • setSourceWidth

        public void setSourceWidth​(Number sourceWidth)
        The width of the original chart when exported, unless an explicit chart.width is set. The width exported raster image is then multiplied by scale.
      • setType

        public void setType​(ExportFileType type)
        Default MIME type for exporting if chart.exportChart() is called without specifying a type option. Possible values are image/png, image/jpeg, application/pdf and image/svg+xml.

        Defaults to: image/png

      • setUrl

        public void setUrl​(String url)
        The URL for the server module converting the SVG string to an image format. By default this points to Highchart's free web service.

        Defaults to: https://export.highcharts.com