数据格式
echarts 地图格式中的lines绘制
当coordinateSystem为'amap','bmap','geo'等坐标系底图时,line的data格式应该如下
const data = [
{
coords: [
[118, 15], // 第一条线的起点坐标 (经度, 纬度)
[120, 18] // 第一条线的终点坐标 (经度, 纬度)
]
},
{
coords: [
[121, 20], // 第二条线的起点坐标 (经度, 纬度)
[123, 22] // 第二条线的终点坐标 (经度, 纬度)
]
}
];
myChart.setOption({
id: "lines_test",
type: "lines",
coordinateSystem: "amap",
polyline: true,
effect: {
show: true,
trailLength: 0.7,
color: "blue",
symbol: "circle",
symbolSize: 5,
},
lineStyle: {
color: "blue",
width: 2,
opacity: 0.8,
},
data,
})