Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Highcharts with export functionality with 'react-highcharts'

In the codebase I work in, we have react-highcharts rather than highcharts-react-official and I am trying to enable highcharts export functionality.

I went to the react-highcharts doc and it says to use deprecated libraries - http://kirjs.github.io/react-highcharts/more.html

Does anyone know how I can use export functionality without using highcharts-exporting and highcharts-more since they are deprecated, with react-highcharts instead of highcharts-react-official?

like image 493
Pavlin Petkov Avatar asked Jun 22 '26 06:06

Pavlin Petkov


2 Answers

Try this:

// Import Highcharts
import Highcharts from "highcharts";

// Load Highcharts modules
require("highcharts/modules/exporting")(Highcharts);

Example with highcharts-react-official:

  • https://codesandbox.io/s/4r57245nw7
like image 101
Wojciech Chmiel Avatar answered Jun 23 '26 18:06

Wojciech Chmiel


If you are using Next js, try this.

import Highcharts from 'highcharts'
import HighchartsExporting from 'highcharts/modules/exporting'
import HighchartsReact from 'highcharts-react-official'

if (typeof Highcharts === 'object') {
    HighchartsExporting(Highcharts)
}
like image 32
Sai Prasad Avatar answered Jun 23 '26 20:06

Sai Prasad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!