在echarts中使用geo3D绘制的地图上面叠加散列图(scatter3D),图标会被埋在地图中,如何让图标紧靠在地图表面,不让其埋在地图里面?
配置项如下
var uploadedDataURL = "/asset/get/s/data-1527220135675-Hkehv-HJ7.json";
$.getJSON(uploadedDataURL,function(data){
echarts.registerMap("chengdu",data);
//chart=echarts.init(ele);
var option={
geo3D: {
map: "chengdu",
roam: true,
center:[103.9526,30.7617],
itemStyle: {
opacity: 1,
borderWidth: 0.4,
areaColor: '#99ff99',
color: '#99ff99',
borderColor: '#111'
},
label: {
show: true,
textStyle:{
color:'#000',
fontWeight : 'normal',
fontFamily:'sans-serif',
fontSize : 12,
backgroundColor: 'rgba(0,23,11,0)'
},
},
emphasis: { //当鼠标放上去 地区区域是否显示名称
itemStyle:{
color: '#00CED1',
areaColor:'#00CED1',
}
},
viewControl: {
autoRotate: false,
minDistance:0
},
regions:regionsJsonData(data)
},
series:[
{
name: 'spotName',
type: 'scatter3D',
coordinateSystem: "geo3D",
symbol:"circle",
symbolSize: 12,
silent:false,
hoverAnimation:false,
data:[
{
"name":"都江堰",
"value":[103.62,31.00]
},
{
"name":"郫县",
"value":[103.88,30.82]
},
{
"name":"温江",
"value":[103.83,30.70]
},
{
"name":"成华",
"value":[104.10,30.67]
},
{
"name":"青羊",
"value":[104.05 ,30.70]
},
{
"name":"浦江",
"value":[103.50,30.20]
},
{
"name":"新津",
"value":[103.82,30.42]
}
]
}
]
};
myChart.setOption(option);
console.log(myChart.getOption());
function regionsJsonData(geoJson){
var data=[];
for(var i=0;i<geoJson.features.length;++i){
data.push({
"id":geoJson.features[i].properties.id,
"name":geoJson.features[i].properties.name,
"center":geoJson.features[i].properties.cp
});
}
return data;
}
})