<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>myMaptest</title>
<script src="js/echarts.js"></script>
<script src="js/yunnan.js"></script>
<script src="js/china.js"></script>
<script src="js/vue.js"></script>
</head>
<body>
<div id="app">
<div id="main" v-bind:style="main"></div>
</div>
<script>
//Vue
var map1 = new Vue({
el:'#app',
data: {
main:'width:600px;height:700px;'
}
})
//echarts
var myChart = echarts.init(document.getElementById('main'));
var option = {
title: {
text: '云南降水',
left:'center'
}
tooltip: {
show: true,
formatter: '{b}', //提示标签格式
backgroundColor:"#ff7f50",//提示标签背景颜色
textStyle:{color:"#fff"} //提示标签字体颜色
},
series: [{
type: 'map',
mapType: '云南',
label: {
normal: {
show: true,
textStyle:{color:"#c71585"}
},
emphasis: {//对应的鼠标悬浮效果
show: true,
textStyle:{color:"#800080"}
}
},
itemStyle: {
normal: {
borderWidth: .5,//区域边框宽度
borderColor: '#009fe8',//区域边框颜色
areaColor:"#00efd5",//区域颜色
},
emphasis: {
borderWidth: .5,
borderColor: 'BLACK',
areaColor:"#ffffff",
}
},
zlevel: 1
}],
};
myChart.setOption(option);
</script>
</body>
</html>
http://echarts.baidu.com/api.html#echarts.registerMap
你用到了地图,但是只导入,echarts对象没有注册地图,详情看上述官方文档
求助大神,帮小弟看看哇