series数组里面 坐标定位 会重叠 坐标无效
配置项如下
option = {
title: {
text: '关系图'
},
series: [{
type: 'graph',
layout: 'none',
symbolSize: 50,
roam: true,
label: {
normal: {
show: true
}
},
edgeSymbol: ['circle', 'arrow'],
edgeSymbolSize: [4, 10],
edgeLabel: {
normal: {
textStyle: {
fontSize: 20
}
}
},
data: [{
name: '节点1',
x: 50,
y: 50
}, {
name: '节点2',
x: 150,
y: 50
}, {
name: '节点3',
x: 100,
y: 80
}, {
name: '节点4',
x: 100,
y: 20
}],
links: [{
source: '节点1',
target: '节点3'
}, {
source: '节点2',
target: '节点3'
}, {
source: '节点2',
target: '节点4'
}, {
source: '节点1',
target: '节点4'
}],
lineStyle: {
normal: {
opacity: 0.9,
width: 2,
curveness: 0
}
}
},{
type: 'graph',
layout: 'none',
symbolSize: 50,
roam: true,
label: {
normal: {
show: true
}
},
edgeSymbol: ['circle', 'arrow'],
edgeSymbolSize: [4, 10],
edgeLabel: {
normal: {
textStyle: {
fontSize: 20
}
}
},
data: [{
name: '节点5',
x: 300,
y: 300
}, {
name: '节点6',
x: 400,
y: 300
}, {
name: '节点7',
x: 350,
y: 350
}, {
name: '节点8',
x: 350,
y: 250
}],
// links: [],
links: [ {
source: '节点5',
target: '节点7'
}, {
source: '节点6',
target: '节点7'
}, {
source: '节点6',
target: '节点8'
}, {
source: '节点5',
target: '节点8'
}],
lineStyle: {
normal: {
opacity: 0.9,
width: 2,
curveness: 0
}
}
}
]
};