把下面代码直接复制粘贴到echarts官网代码块部分(http://echarts.baidu.com/echarts2/doc/example/map20.html)
// 数据格式 [经度,纬度] var heatData = [[116.11,39.852], [116.21,39.952], [116.31,39.957], [116.41,39.959], ]; option = { color: ['red','yellow','#d8e050'], tooltip : { trigger: 'item', formatter: '{b}' }, series : [ { name: '妥投量', type: 'map', mapType: '北京', roam: false, mapLocation:{x:'center',y:'2%'}, itemStyle:{ normal:{ label:{ show:true, textStyle:{ fontSize : '12', fontFamily:'Microsoft YaHei', color:'#00ffff' } }, borderColor:'#5ef9f7', borderWidth:1, areaStyle:{ color: '#210874' } } }, data:[], heatmap: { minAlpha: 0.5, data: heatData }, } ] };
效果如图:
