Daniel Loiterton
Daniel Loiterton

Reputation: 5306

how to import highcharts sub modules in React app

I've been using the react-jsx-highcharts module, to integrate Highcharts into my React app.

Works great. Now I want to include the boost module. I'm not sure how to do this. I tried simply adding import 'highcharts/modules/boost' but this doesn't seem to work.

Anyone know how to go about this?

Upvotes: 4

Views: 3595

Answers (1)

Daniel Loiterton
Daniel Loiterton

Reputation: 5306

This is a feature of the highcharts module (not react-jsx-highcharts) and is explained in its documentation:

var Highcharts = require('highcharts');
require('highcharts/modules/boost')(Highcharts);

Alternatively, you can use import like so:

import Highcharts from 'highcharts';
import boost from 'highcharts/modules/boost';
boost(Highcharts);

Upvotes: 10

Related Questions