<div id="main">
</div>
var myChart = echarts.init(document.getElementById(‘main’));
myChart.setOption(option);
option = {
tooltip: {
formatter:function(params,ticket, callback){
return params.seriesName+’
’+params.name+’:’+params.value
}
},
visualMap: {
min: 0,
max: 1500,
left: ‘left’,
top: ‘bottom’,
text: [‘高’,‘低’],
inRange: {
color: [’#e0ffff’, ‘#006edd’]
},
show:true
},
geo: {
map: ‘china’,
roam: false,
zoom:1.23,
label: {
normal: {
show: true,
fontSize:‘10’,
color: ‘rgba(0,0,0,0.7)’
}
},
itemStyle: {
normal:{
borderColor: ‘rgba(0, 0, 0, 0.2)’
},
emphasis:{
areaColor: ‘#F3B329’,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: ‘rgba(0, 0, 0, 0.5)’
}
}
},
series : [
{
name: ‘信息量’,
type: ‘map’,
geoIndex: 0,
data:dataList
}
]
};
var dataList=[
{name:“南海诸岛”,value:2143},
{name: ‘北京’, value: 3455},
{name: ‘天津’, value: 2232},
{name: ‘上海’, value: 1243}
]
myChart.on(‘click’, function (params) {
alert(params.name+’:’+params.seriesName+’:’+params.value);
});