下面是代码:
var data = [
['tn-4431', 0],
['tn-sf', 1],
['tn-me', 2],
['tn-to', 3],
['tn-mn', 4],
['tn-bj', 5],
['tn-ba', 6],
['tn-bz', 7],
['tn-je', 8],
['tn-nb', 9],
['tn-tu', 10],
['tn-kf', 11],
['tn-ks', 12],
['tn-gb', 13],
['tn-gf', 14],
['tn-sz', 15],
['tn-sl', 16],
['tn-mh', 17],
['tn-ms', 18],
['tn-kr', 19],
['tn-ss', 20],
['tn-za', 21],
['tn-kb', 22],
['tn-ta', 23]
];
// Create the chart
Highcharts.mapChart('container', {
chart: {
map: 'countries/tn/tn-all'
},
title: {
text: 'Highmaps basic demo'
},
subtitle: {
text: 'Source map: <a href="http://code.highcharts.com/mapdata/countries/tn/tn-all.js">Tunisia</a>'
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
colorAxis: {
min: 0
},
series: [{
data: data,
name: 'Random data',
states: {
hover: {
color: '#BADA55'
}
},
dataLabels: {
enabled: true,
format: '{point.name}'
}
}]
});<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/maps/modules/map.js"></script>
<script src="https://code.highcharts.com/mapdata/countries/tn/tn-all.js"></script>
<div id="container"></div>
因为我已经在代码中使用了Highcharts.js来呈现折线图和极线图,所以我不能使用highmaps。我遵循了Highcharts地图的一般文档,并安装了highcharts的插件。代码在一天前还不错,它渲染了地图,但现在它在chrome控制台中显示了这个错误:"Uncaught : Cannot read property 'dataMin‘of undefined“。有什么解决方案吗?提前谢谢。
发布于 2020-05-06 18:32:36
我重现了你的代码,看起来一切都很好:https://jsfiddle.net/BlackLabel/cjr9p7oq/
// Create the chart
Highcharts.mapChart('container', {
...
});这可能是新版本发布后与绑定文件相关的临时问题。请确认是否一切正常。
https://stackoverflow.com/questions/61626453
复制相似问题