- 仅作个人学习使用

select: {
disabled: true
},
export default (data, _this) => {
const mapName = data.mapName;
const mapList = data.mapList || [
{name:'庆云县',value:88},
{name:'平原县',value:12},
];
let options = {
tooltip: {
show:true,
trigger: 'item',
formatter: '{b}: {c}'
},
geo: {
map: mapName,
type: 'geo',
roam: false,
zoom: 1.1,
label: {
show: false
},
itemStyle: {
shadowColor: 'rgb(4,122,187)',
shadowOffsetX: 5,
shadowOffsetY: 10,
shadowBlur: 5
}
},
visualMap: {
show:true,
min: 0,
max: 100,
left: 'left',
top: 'bottom',
text: ['高', '低'],
calculable: true,
inRange: {
color: ['#fff3f3', '#ffd9d9', '#ffadad', '#ff7575']
}
},
series: [{
type: 'map',
map: mapName,
z: 0,
zoom: 1.1,
label: {
normal: {
show: true,
color: '#fff',
fontSize: 12,
},
emphasis: {
textStyle: {
color: '#fff'
}
}
},
itemStyle: {
normal: {
borderColor: '#c5ecfa',
borderWidth: 2,
areaColor: {
type: 'linear',
x: 0,y: 1,x2: 0,y2: 0,
colorStops: [
{ offset: 0, color: '#438bfb' },
{ offset: 1, color: '#5cacf9' }
]
}
},
emphasis: {
borderColor: '#c5ecfa',
borderWidth: 2,
areaColor: undefined,
},
},
select: {
disabled: true
},
animation: false,
data: mapList
}]
}
return options;
}