要想给echarts设置背景阴影,重要的是要将地图固定。
下面是源码:
option = {
backgroundColor: '#000',//画布背景颜色
geo: {
show: true,
map: 'china',
label: {
normal: {
show: false
},
emphasis: {
show: false,
}
},
roam: false,//地图设置不可拖拽,固定的
itemStyle: {
normal: {
areaColor: '#006fff',
borderWidth: 0,
shadowColor: 'rgba(0,54,255, 1)',
shadowBlur: 100
}
}
},
series: [
{
type: 'map',
map: 'china',
geoIndex: 1,
aspectScale: 0.75, //长宽比
showLegendSymbol: false, // 存在legend时显示
label: {
normal: {
show: false,
},
emphasis: {
show: false,
textStyle: {
color: '#fff'
}
}
},
roam: false,
itemStyle: {
normal: {
areaColor: '#006fff',
borderColor: '#0145a4',
borderWidth: 1
},
emphasis: {
areaColor: '#006fff'
}
},
}]
}
下面是效果图: