pyecharts第五节、关系图
生活随笔
收集整理的這篇文章主要介紹了
pyecharts第五节、关系图
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
需要安裝pyecharts
pip install pyecharts -U創建【demo5.py】測試類
?
輸入以下編碼:
from pyecharts import options from pyecharts.charts import Graphnodes = [{"name": "星光點1", "symbolSize": 30},{"name": "暗影星2", "symbolSize": 30},{"name": "光芒星3", "symbolSize": 30},{"name": "閃耀星4", "symbolSize": 30},{"name": "縱橫星5", "symbolSize": 30},{"name": "智慧星6", "symbolSize": 30} ] links = [] for i in nodes:for j in nodes:links.append({"source": i.get("name"), "target": j.get("name")})g = (Graph().add("", nodes, links, repulsion=8000).set_global_opts(title_opts=options.TitleOpts(title="六星光芒陣演示")).render("guangmang.html") )執行:
打開生成文件:
?
效果圖如下:
希望能對大家有所幫助。
總結
以上是生活随笔為你收集整理的pyecharts第五节、关系图的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pyecharts第四节、漏斗图
- 下一篇: ImportError: cannot