百度echarts中國地圖,去掉地圖底色,改為透明色:
1、首先把為地圖著色的series去掉(地圖保留打點(diǎn))
2、geo 里的itemstyle設(shè)置區(qū)域顏色的改為:'rgba(128, 128, 128, 0)', 最后以為設(shè)置0位全透明,
代碼如下:
geo: {
map: 'china',
roam: false,
zoom: 1.2,
//center: [110.97, 35.71],
label: {
normal: {
show: false,
textStyle: {
color: "#F0F8FB"
}
},
emphasis: {
show: false,
textStyle: {
color: "#F0F8FB"
}
}
},
itemStyle: {
normal: {
areaColor: 'rgba(128, 128, 128, 0)', //rgba設(shè)置透明度0
borderColor: '#007bf1',//省份邊框顏色
borderWidth:1.5,//省份邊框
},
emphasis: {
areaColor: '#0f2c70'
}
},
regions: [
{
name: "南海諸島",
value: 0,
itemStyle: {
normal: {
opacity: 1,
label: {
show: false
}
}
}
}
]
},