Highcharts is a JavaScript charting library based on SVG, with fallbacks to VML and canvas for old browsers. This package also contains Highstock, the financial charting package, and Highmaps for geo maps.
This package is intended for supporting client-side JavaScript charting through bundlers like Parcel or Webpack and environments like Babel or TypeScript. If you indend to generate static charts on the server side, use the Highcharts node.js Export Server instead.
Download and install Highcharts
Please note that there are several ways to use Highcharts. For general installation instructions, see the docs.
Use our CDN
Instead of downloading, you can use our CDN to access files directly. See code.highcharts.com for details.
<script src="https://code.highcharts.com/highcharts.js"></script>
Install from npm
See npm documentation on how to get started with npm.
npm install --save highcharts
Install from Bower
See Bower documentation on how to get started with Bower.
bower install highcharts
Load Highcharts as a CommonJS module
Highcharts is using an UMD module pattern, as a result it has support for CommonJS.
The following examples presumes you are using npm to install Highcharts, see Download and install Highcharts for more details.
var Highcharts = require('highcharts');
require('highcharts/modules/exporting')(Highcharts);
Highcharts.chart('container', {
});
Load Highcharts as an ES6 module
Since Highcharts supports CommonJS, it can be loaded as an ES6 module with the use of transpilers. Two common transpilers are Babel and TypeScript. These have different interpretations of a CommonJS module, which affects your syntax.
The following examples presumes you are using npm to install Highcharts, see Download and install Highcharts for more details.
Babel
import Highcharts from 'highcharts';
import Exporting from 'highcharts/modules/exporting';
Exporting(Highcharts);
Highcharts.chart('container', {
});
TypeScript
import * as Highcharts from 'highcharts';
import * as Exporting from 'highcharts/modules/exporting';
Exporting(Highcharts);
Highcharts.chart('container', {
});