Book Image

Highcharts Essentials

By : Bilal Shahid
Book Image

Highcharts Essentials

By: Bilal Shahid

Overview of this book

Table of Contents (16 chapters)
Highcharts Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Exporting Highcharts into other formats


Highcharts provides a module to export charts into various image formats. There can be two possibilities when considering the export server, that is, to use Highcharts' official exporting server or set up your own server. We will use the export module to export our charts into various formats using the Highcharts CDN.

To enable exporting, the exporting.js file must be included after the highcharts.js file. It can be found in the Highcharts-4.x.x/js/modules folder and can also be included directly from http://code.highcharts.com/modules/exporting.js.

To enable simple exporting, we need to set exporting.enabled to true in our chart configuration object:

$( '...' ).highcharts({
  ...
  exporting: {
    enabled: true
  },
  ...
});

By doing so, a button with a drop-down menu appears at the top-right corner of the chart:

The drop-down menu contains various options to export charts into formats including PNG, JPEG, PDF, and SVG.

You can alter various properties...