在过去的几天里,我一直在努力在我的 React 项目中使用这种 highchart 地图类型 https://jsfiddle.net/26tbkjov//
有人可以帮我吗?请检查我到目前为止所取得的成就: https ://codesandbox.io/s/highcharts-react-demo-0m5ux
我正在使用那些 highcharts npm 包
"highcharts": "^7.1.2", "highcharts-react-official": "^2.2.2",
我尝试了很多事情,但最终陷入了死胡同。以下是我尝试过的最后一件事:
import React from "react";
import mapData from '../../api/mapData';
import Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';
require('highcharts/modules/map')(Highcharts);
class MyMap extends React.Component {
constructor(props) {
super(props);
this.state = {
mapValues: [],
modalClassic: false,
};
this.mapData = new mapData();
// preparing the config of map with empty data
this.options = {
title: {
text: 'Widget click by location',
style: {
color: '#fff'
},
}, …Run Code Online (Sandbox Code Playgroud)