Reputation: 31
As per npm highcharts-more.js is deprecated and we just need to import respective modules from the highcharts folder. But when I try to remove highcharts-more dependency I am getting error. We are trying to build a boxplot using react-highcharts v16.0.2.
I even tried removing highcharts-more.js import from their demo and see that it fails.
Am i missing anything in the implementation aspect here ?
Upvotes: 2
Views: 2008
Reputation: 2674
Try highcharts-react-official instead of react-highcharts:
import React from "react";
import { render } from "react-dom";
// Import Highcharts
import Highcharts from "highcharts";
import HighchartSankey from "highcharts/modules/sankey";
import HighchartsWheel from "highcharts/modules/dependency-wheel";
import HighchartsReact from "highcharts-react-official";
HighchartSankey(Highcharts);
HighchartsWheel(Highcharts);
const Viz = () => {
return (
<HighchartsReact
highcharts={Highcharts}
options={{
series: [{
type: "dependencywheel",
data: [{
from: "Category1",
to: "Category2",
weight: 2
}, {
from: "Category1",
to: "Category3",
weight: 5
}]
}]
}}
/>
);
};
render(<Viz />, document.getElementById("root"));
Upvotes: -1
Reputation: 10075
Import required dependencies as
import ReactHighchart from 'react-highcharts';
import HighchartMore from 'highcharts/highcharts-more';
HighchartMore(ReactHighchart.Highcharts);
StackBlitz Demo
There is no deprecated dependency
Upvotes: 3