发布于 2018-07-23 01:18:24
将所需的依赖项导入为
import ReactHighchart from 'react-highcharts';
import HighchartMore from 'highcharts/highcharts-more';
HighchartMore(ReactHighchart.Highcharts);没有过时的依赖项
发布于 2020-10-28 09:46:16
尝试highcharts-react-official而不是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"));https://stackoverflow.com/questions/51442436
复制相似问题