首页 > 编程知识 正文

echarts展示neo4j,pyecharts关系图

时间:2023-05-05 11:03:32 阅读:13389 作者:2606

<!DOCTYPE html><html><head> <meta name="viewport" content="width=device-width"/> <title>ECharts 关系图谱</title> <script src="jquery-1.10.2.min.js"></script> <script src="echarts.min.js"></script> <style type="text/css"> html, body, #main { height: 100%; width: 100%; margin: 0; padding: 0 } </style></head><body><div id="main" style=""></div><script type="text/javascript"> var myChart = echarts.init(document.getElementById('main')); option = { title: {text: '关系图谱'}, tooltip: { formatter: function (x) { return x.data.des; } }, series: [ { type: 'graph', layout: 'force', symbolSize: 80, roam: true, edgeSymbol: ['circle', 'arrow'], edgeSymbolSize: [4, 10], edgeLabel: { normal: { textStyle: { fontSize: 20 } } }, force: { repulsion: 2500, edgeLength: [10, 50] }, draggable: true, itemStyle: { normal: { color: '#4b565b' } }, lineStyle: { normal: { width: 2, color: '#4b565b' } }, edgeLabel: { normal: { show: true, formatter: function (x) { return x.data.name; } } }, label: { normal: { show: true, textStyle: {} } }, data: [ { name: 'csdtk, des: '退休', symbolSize: 100, itemStyle: { normal: { color: 'red' } } }, { name: '简单的滑板', des: '自己创业', itemStyle: { normal: { color: 'red' } } }, { name: '王五', des: '测试人员', symbolSize: 100 }, { name: '天天', des: '程序员', itemStyle: { normal: { color: 'red' } } } ], links: [ { source: 'csdtk, target: '简单的滑板', name: '姐妹', des: '张三与户主【简单的滑板】关系为姐妹' }, { source: '王五', target: '简单的滑板', name: '朋友' }, { source: '天天', target: '王五', name: "同事" }, { source: '简单的滑板', target: '天天', name: "父子" } ] } ] }; myChart.setOption(option);</script></body></html>

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。