Toggle navigation
关系图
By
s***0
2021-02-08 04:12:38
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
option = { title: { text: '关系图', top: '12%', left: 'center' }, label: { normal: { show: true } }, legend: { x: "center", show: true, top: '20%', data: ["男性", "女性"] }, series: [ { type: 'graph',//关系图 layout: 'force',//力导向图的布局 symbolSize: 50,//节点大小 focusNodeAdjacency: true,//鼠标悬停在节点上时,会隐藏和当前节点非直接连接的节点 categories: [{ //节点类别 name: '男性', itemStyle: { normal: { color: "#009800", } } }, { name: '女性', itemStyle: { normal: { color: "#4592FF", } } }], label: { //节点名称 normal: { show: true, textStyle: { fontSize: 20 //节点名称显示大小 }, } }, force: { repulsion: 1000 //节点之间的排斥力 }, edgeLabel: { normal: { show: true, textStyle: { fontSize: 10 }, formatter: "{c}" } }, data: [{ name: 'A',//节点名称 category: 0,//节点类型 draggable: true,//节点是否可拖动 }, { name: 'B', category: 1, draggable: true, }, { name: 'C', category: 0, draggable: true, }, { name: 'D', category: 1, draggable: true, }, { name: 'E', category: 0, draggable: true, }, { name: 'F', category: 1, draggable: true, }, { name: 'G', category: 1, draggable: true, },{ name: 'H', category: 1, draggable: true, }], links: [{ source: 0,//关系的起点 target: 1,//关系的终点 value: '夫妻'//关系类型 },{ source: 0, target: 3, value: '父子' }, { source: 0, target: 5, value: '朋友' }, { source: 4, target: 5, value: '同事' }, { source: 2, target: 7, value: '夫妻' }, { source: 1, target: 7, value: '朋友' }, { source: 1, target: 4, value: '朋友' }, { source: 1, target: 6, value: '朋友' } ], lineStyle: { //关系连接线的样式设置 normal: { opacity: 0.9,//关系连接线的不透明度为0.9 width: 3,//关系连接线的宽度 curveness: 0//关系连接线的弯曲程度 } } } ] };