模块导入:
from pyecharts import options as opts
from pyecharts.charts import Graph, Page
nodes、links:字典list
nodes = [{"name":a,"xx":1},{"name":b,"xx":2},{"name":c,"xx":3}]
links = [{"source":a,"target":b}]
调用:
graph = Graph()
graph.add("Name:", nodes,links, repulsion=8000)
graph.set_global_opts(title_opts=opts.TitleOpts("表名"))
graph.render()#生成render.html