今天用到了Echarts的中国地图map,但Echarts官网的地图js已经停止提供下载了,找了下其他的链接放到这里,一些其他会用到的js文件也在里面可以找到,省的下次用现找:https://github.com/apache/incubator-echarts
链接: 5 分钟上手 ECharts
配置option:
var ec_center_option = {
title: {
text: '',
subtext: '',
x: 'left'
},
tooltip: {
trigger: 'item'
},
visualMap: {
show: true,
x: 'left',
y: 'bottom',
textStyle: {
fontSize: 8,
},
splitList: [{start: 1, end: 9},
{start: 10, end: 99},
{start: 100, end: 999},
{start: 1000, end: 9999},
{start: 10000}],
color: ['#8A3310', '#C64918', '#E55B25', '#F2AD92', '#F9DCD1']
},
//配置属性
series: [{
name: '累计确诊人数',
type: 'map',
mapType: 'china',
roam: false,
itemStyle: {
normal: {
borderWidth: .5,
borderColor: '#009fe8',
areaColor: "#ffefd5",
},
emphasis: {
borderWidth: .5,
borderColor: '#4b0082',
areaColor: "#fff",
}
},
label: {
normal: {
show: true,
fontSize: 8,
},
emphasis: {
show: true,
fontSize: 8,
}
},
data: mydata
}]
};
ec_center.setOption(ec_center_option)