版权声明:欢迎任何形式的转载,但请务必注明出处,共创知识服务 https://blog.csdn.net/ASUKA2020/article/details/83891572
option = {
title: {
text: '简单网络拓扑'
},
tooltip: {},
animationDurationUpdate: 1500,
animationEasingUpdate: 'quinticInOut',
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: 100,
y: 100
}, {
name: '服务器2',
x: 220,
y: 310
}, {
name: '路由器',
x: 100,
y: 200
}, {
name: '服务器4',
x: 10,
y: 300
}],
// links: [],
links: [{
source: '路由器',
target: '服务器1'
}, {
source: '路由器',
target: '服务器2'
}, {
source: '路由器',
target: '服务器4'
}],
lineStyle: {
normal: {
opacity: 0.9,
width: 2,
curveness: 0
}
}
}
]
};