在关系图的label 的 formatter中,无法使用类似 {@name} 这种方式,指定显示的label, 在edgeLabel中也是如此
配置项如下
option = {
backgroundColor: '#1a4377',
title: {
text: 'Graph 简单示例'
},
series: [{
type: 'graph',
layout: 'force',
force: {
edgeLength: [ 100, 200 ]
},
data: [{
"value": "万紫千红",
"symbolSize": 30,
"draggable": "true",
"name": "1966384077",
"link": "https://admin.p.adm-corp.kuaishou.com/frontend/archives/index.html#/archives/user/profile?userId=1966384077",
},
{
"value": "万丈光芒",
"symbolSize": 10,
"draggable": "true",
"name": "123456",
"link": "https://admin.p.adm-corp.kuaishou.com/frontend/archives/index.html#/archives/user/profile?userId=1966384077"
}
],
label: {
show: true,
formatter: "{@name}" // 这里没有生效
},
edgeLabel: {
show: true,
formatter: "{@sideDesc}" // 这里也没有生效
},
links: [{
"source": "1966384077",
"target": "123456",
"sideDesc": "这是边的描述",
}],
lineStyle: {
normal: {
opacity: 0.9,
width: 5,
}
},
}]
};