Highcharts JS is a JavaScript charting library based on SVG, with fallbacks to VML and canvas for old browsers.
- Official website: www.highcharts.com
- Download page: www.highcharts.com/download
- Licensing: www.highcharts.com/license
- Support: www.highcharts.com/support
- Issues: Repo guidelines
This is the working repo for Highcharts. If you simply want to include Highcharts into a project, use the distribution package instead, or read the download page. Please note that there are several ways to use Highcharts. For general installation instructions, see the docs.
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.src.js"></script>
See npm documentation on how to get started with npm.
npm install --save highcharts
See Bower documentation on how to get started with Bower.
bower install highcharts
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.
// Load Highcharts
var Highcharts = require('highcharts');
// Alternatively, this is how to load Highstock. Highmaps is similar.
// var Highcharts = require('highcharts/highstock');
// Load the exporting module, and initialize it.
require('highcharts/modules/exporting')(Highcharts);
// Generate the chart
Highcharts.chart('container', {
// options - see https://api.highcharts.com/highcharts
});
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.
import Highcharts from 'highcharts';
// Alternatively, this is how to load Highstock. Highmaps is similar.
// import Highcharts from 'highcharts/highstock';
// Load the exporting module.
import Exporting from 'highcharts/modules/exporting';
// Initialize exporting module.
Exporting(Highcharts);
// Generate the chart
Highcharts.chart('container', {
// options - see https://api.highcharts.com/highcharts
});
import * as Highcharts from 'highcharts';
// Alternatively, this is how to load Highstock. Highmaps is similar.
// import Highcharts from 'highcharts/highstock';
// Load the exporting module.
import * as Exporting from 'highcharts/modules/exporting';
// Initialize exporting module.
Exporting(Highcharts);
// Generate the chart
Highcharts.chart('container', {
// options - see https://api.highcharts.com/highcharts
});
If you want to do modifications to Highcharts or fix issues, you may build your own files. Highcharts uses Gulp as the build system. After npm install
in the root folder, run gulp
, which will set up a watch task for the JavaScript and SCSS files. Now any changes in the files of the /js
or /css
folders will result in new files being built and saved in the code
folder. Other tasks are also available, like gulp lint
.
npm install
gulp