pycharts簡介 五分鐘上手
Introduction
ECharts是百度開源一款可視化產品,Python可以直接調用ECharts,就是pyecharts。
Environment
安裝pycharts
(此處使用pip3安裝)
1 | pip3 install pyecharts |
測試是否安裝完成
1 | import pyecharts |
如果得到一個版本號就是安裝完成啦!
Pycharts
直接開始第一個圖表!
1 | from pyecharts.charts import Bar |
默認會在當前目錄生成render.html
bar.render()中也可以傳入路徑或參數,例如bar.render(“mycharts.html”)
執行後生成的html就是你的圖表啦!
除了以上寫法,也可以這樣寫:
1 | from pyecharts.charts import Bar |
若是想要配置標題,可以這樣做:
1 | .set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题")) |
完整程式碼:
1 | from pyecharts.charts import Bar |
也可以直接使用字典參數:
1 | .set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题")) |
Demo
更多demo:
簡單的介紹就到這啦!
剩下的強大功能就大家自己到官網尋找啦~
指路 👉 官網

Invitation
Isadora
20010718
created:05/02/2021
Welcome to My Blog
Whether u have any question or not, feel free to send messages to me <3
Welcome to Isadora's blog, wish u a nice day.
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
GitalkFacebook Comments