Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 505
Daniel Loiterton Avatar asked Oct 27 '25 14:10

Daniel Loiterton


1 Answers

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);
like image 57
Daniel Loiterton Avatar answered Oct 30 '25 07:10

Daniel Loiterton