效果图:
image.png
配置:
var option = {
title: {
text: '人物关系拓扑图',
show: true,
textStyle: {
color: '#fff',
fontWeight: 'normal'
},
padding: [10, 0, 10, -90],
left: '50%'
},
tooltip: {},
animationDuration: 1,
animationDurationUpdate: 1500,
animationEasingUpdate: 'quinticInOut',
label: {
normal: {
show: true,
textStyle: {
fontSize: 12
},
}
},
legend: {
x: "center",
show: false,
data: ["事件", "人物"]
},
series: [
{
type: 'graph',
layout: 'force',
force: {
repulsion: 1000,
gravity: 0.01
},
symbolSize: 45,
focusNodeAdjacency: true,
roam: 'scale',
categories: [{
name: '事件',
itemStyle: {
normal: {
color: "#fff",
}
}
}, {
name: '人物',
itemStyle: {
normal: {
color: "#fff",
}
}
}],
label: {
normal: {
show: true,
<