geo-->label--.offset/position不起作用
配置项如下
var hsl = {
h: 200,
s: 30,
l: 90
};
option = {
title: {
text: 'geo-->label--.offset/position不起作用',
right: 'center'
},
backgroundColor: new echarts.graphic.RadialGradient(0.5, 0.5, 1, [{
offset: 0,
color: 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%)'
}, {
offset: 1,
color: 'hsl(' + hsl.h + ',' + hsl.s + '%,' + parseInt(hsl.l / 2) + '%)'
}]),
geo: {
map: 'china',
roam: true,
label: {
show: true,
position: 'right',
backgroundColor: 'white',
padding: 5,
offset: [10, 210],
},
itemStyle: {
areaColor: '#085c7b',
borderColor: '#cfe7ee'
}
}
};
setTimeout(function() {
var data = [];
var nameMap = myChart.getModel().getComponent('geo').coordinateSystem._nameCoordMap.data;
for (key in nameMap) {
data.push({
name: key,
value: nameMap[key].concat(Math.random())
})
}
myChart.setOption({
series: [{
coordinateSystem: 'geo',
type: 'effectScatter',
data: data,
symbolSize: 5,
itemStyle: {
color: 'yellowgreen'
}
}]
})
console.log()
}, 100);