Graph-基本示例
1 import Json 2 import os 3 4 from pyecharts import options as opts 5 from pyecharts.charts import Graph,Page 6 7 8 nodes = [ 9 {"name": "结点1","symbolSize": 10},10 {"name": "结点2","symbolSize": 20},11 {"name": "结点3","symbolSize": 30},12 {"name": "结点4","symbolSize": 40},13 {"name": "结点5","symbolSize": 50},14 {"name": "结点6",15 {"name": "结点7",16 {"name": "结点8",17 ]18 links = []19 for i in nodes:20 for j in nodes:21 links.append({"source": i.get("name"),"target": j.get("name")})22 23 graph= (24 Graph()25 .add("",nodes,links,repulsion=8000)26 .set_global_opts(Title_opts=opts.TitleOpts(Title="Graph-基本示例"))27 )28 graph.render()总结
以上是内存溢出为你收集整理的小白学Python(18)——pyecharts 关系图 Graph全部内容,希望文章能够帮你解决小白学Python(18)——pyecharts 关系图 Graph所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)