我想要在地图上显示data数据,但是显示不出来是为什么?包括鼠标移到省份上连提示框也没有
drawChinaMapChart() {
let myChart = this.$echarts.init(document.getElementById('chinaMap'));
let airData = [
{name:'北京市',value:39.93},
{name:'天津市',value:39.13},
{name:'河北省',value:147},
{name:'山西省',value:39},
{name:'内蒙古自治区',value:58},
{name:'辽宁省',value:50},
{name:'吉林省',value:51},
{name:'黑龙江省',value:114},
{name:'上海市',value:31.23},
{name:'江苏省',value:67},
{name:'浙江省',value:84},
{name:'安徽省',value:117},
{name:'福建省',value:29},
{name:'江西省',value:96},
{name:'山东省',value:92},
{name:'河南省',value:113},
{name:'湖北省',value:273},
{name:'湖南省',value:175},
{name:'广东省',value:38},
{name:'广西壮族自治区',value:59},
{name:'海南省',value:54},
{name:'重庆市',value:66},
{name:'四川省',value:58},
{name:'贵州省',value:71},
{name:'云南省',value:25},
{name:'西藏自治区',value:24},
{name:'陕西省',value:61},
{name:'甘肃省',value:99},
{name:'青海省',value:57},
{name:'宁夏回族自治区',value:52},
{name:'新疆维吾尔自治区',value:84},
{name:'台湾省',value:88},
{name:'香港特别行政区',value:66},
{name:'澳门特别行政区',value:77},
]
echarts.registerMap('china', this.chinaMap);
let option = {
title: {
text: '测试图',
},
// 地图配置
geo: {
nameMap: {
China: '中国',
},
map: 'china',
label: {
emphasis: {
show: false,
},
show:true
},
// 当前视角的缩放比例
zoom: 1.2, // 2.3
// left: -300,
// top: 250,
// scale 地图的长宽比
aspectScale: 1,
roam:true,
itemStyle: {
normal: {
borderColor: '#21EAFD', // 区域边框颜色
areaColor: 'rgba(255,255,255,0)', // 区域颜色
borderWidth: 1, // 区域边框宽度
shadowBlur: 5,
shadowColor: 'rgba(107,91,237,.7)',
},
emphasis: {
borderColor: '#FFD1A3',
areaColor: 'rgba(102,105,240,.3)',
borderWidth: 1,
shadowBlur: 5,
shadowColor: 'rgba(135,138,255,.5)',
},
},
},
tooltip: {
trigger: 'item'
},
series: [{
data: airData,
type:'map',
}],
};
myChart.setOption(option);
},