连线地图 设置emphasis.label.position='middle'不起作用,还是用到默认的end
配置项如下
option = {
"textStyle": {
"color": "#fff"
},
"title": {
"show": false,
"text": "",
"textStyle": {
"color": "#fff"
},
"left": "center"
},
"tooltip": {
"trigger": "item",
"show": false
},
"toolbox": {
"show": false,
"orient": "vertical",
"left": "right",
"top": "center",
"feature": {
"dataView": {
"readOnly": false
},
"restore": {},
"saveAsImage": {}
}
},
"backgroundColor": "rgba(0,0,0,0)",
"geo": [{
"map": "china",
"roam": false,
"label": {
"normal": {
"show": false,
"textStyle": {
"color": "#fff"
}
},
"emphasis": {
"show": false,
"textStyle": {
"color": "#fff"
}
}
},
"itemStyle": {
"normal": {
"areaColor": "rgba(0,0,0,0.1)",
"borderColor": "rgba(0,0,0,0.5)",
"borderWidth": 1
},
"emphasis": {
"areaColor": "#81f214"
}
},
"selectedMode": false
}],
"series": [{
"type": "scatter",
"coordinateSystem": "geo",
"data": [{
"name": "青岛a",
"value": [120.33, 36.07],
"itemStyle": {
"color": "#ff0000"
}
}, {
"name": "上海b",
"value": [121.48, 31.22],
"itemStyle": {
"color": "#7FFF00"
}
}, {
"name": "青岛",
"value": [120.33, 36.07],
"itemStyle": {
"color": "#ff0000"
}
}, {
"name": "上海",
"value": [121.48, 31.22],
}, {
"name": "北京",
"value": [116.46, 39.92],
"symbolSize": 20
}],
"symbolSize": 13,
"showEffectOn": "render",
"rippleEffect": {
"brushType": "stroke",
"period": 1
},
"hoverAnimation": true,
"label": {
"normal": {
"formatter": "{b}",
"position": "right",
"show": false,
"color": "#fff"
},
"emphasis": {
"show": true
}
},
"itemStyle": {
"normal": {
"color": "#4ce741"
},
"emphasis": {
"color": "#fafefd"
}
},
"zlevel": 15
}, {
"type": "lines",
"zlevel": 8,
"symbolSize": 10,
"lineStyle": {
"normal": {
"color": "#4ce741",
"width": 2,
"opacity": 0.6,
"curveness": 0.2
},
"emphasis": {
"width": 3
}
},
"emphasis":{
"label":{
"show":true,
'position':'middle',
"color":'red'
}
},
"data": [{
"lineStyle": {
"color": "#fc5e2d",
"curveness": -0.8
},
"name": "青岛a - 上海b",
"coords": [
[120.33, 36.07],
[121.48, 31.22]
]
}, {
"lineStyle": {
"color": "#fc5e2d",
"curveness": 0.2
},
"name": "青岛 - 上海",
"coords": [
[120.33, 36.07],
[121.48, 31.22]
]
}, {
"lineStyle": {
"color": "#fc5e2d",
"curveness": 0.2
},
"name": "上海 - 北京",
"coords": [
[121.48, 31.22],
[116.46, 39.92]
]
}]
}, {
"type": "lines",
"zlevel": 9,
"symbolSize": 10,
"lineStyle": {
"normal": {
"color": "#a6c84c",
"width": 0,
"curveness": 0.2
}
},
"emphasis":{
"label":{
"show":true,
'position':'middle',
"color":'red'
}
},
"data": [{
"lineStyle": {
"color": "#fc5e2d",
"curveness": -0.8
},
"name": "青岛1 - 上海2",
"coords": [
[120.33, 36.07],
[121.48, 31.22]
]
}, {
"lineStyle": {
"color": "#fc5e2d",
"curveness": 0.2
},
"name": "青岛 - 上海",
"coords": [
[120.33, 36.07],
[121.48, 31.22]
]
}, {
"lineStyle": {
"color": "#fc5e2d",
"curveness": 0.2
},
"name": "上海 - 北京",
"coords": [
[121.48, 31.22],
[116.46, 39.92]
]
}],
"effect": {
"show": true,
"period": 4,
"trailLength": 0.3,
"color": "#fff",
"symbolSize": 2
},
"itemStyle": {
"normal": {
"color": "#4ce741"
},
"emphasis": {
"color": "#fafefd"
}
}
}],
"animation": false
};