pyEcharts安裝及使用指南(最新)

pyEcharts安裝及使用指南(最新):

網上資料大多數是0.5X的版本, 這裏我給出個人0.5版本鏈接https://www.cnblogs.com/dgwblog/p/11811562.htmlhtml

pyecharts 分爲 v0.5.X 和 v1 兩個大版本,v0.5.X 和 v1 間不兼容,v1 是一個全新的版本,詳見 ISSUE#892ISSUE#1033python

我我的認爲有必要學習新版本,結構清晰,支持鏈式調用git

新版本特性:github

  • 簡潔的 API 設計,使用如絲滑般流暢,支持鏈式調用
  • 囊括了 30+ 種常見圖表,應有盡有
  • 支持主流 Notebook 環境,Jupyter Notebook 和 JupyterLab
  • 可輕鬆集成至 Flask,Django 等主流 Web 框架
  • 高度靈活的配置項,可輕鬆搭配出精美的圖表
  • 詳細的文檔和示例,幫助開發者更快的上手項目
  • 多達 400+ 地圖文件以及原生的百度地圖,爲地理數據可視化提供強有力的支持

打包須要的資源鏈接:app

https://github.com/pyecharts/pyecharts-assetsecharts

幾個網址:框架

http://pyecharts.herokuapp.com學習

https://github.com/pyecharts/pyecharts 項目地址ui

如何你要使用示例資源導入:spa

git clone https://github.com/pyecharts/pyecharts/tree/master/example

方便你操做的數據

from pyecharts import faker

 

配置:

pip 安裝

$ pip(3) install pyecharts

 

源碼安裝

$ git clone https://github.com/pyecharts/pyecharts.git
$ cd pyecharts
$ pip install -r requirements.txt
$ python setup.py install
# 或者執行 python install.py

 

基本例子

# coding=utf-8
from pyecharts.charts import Bar
from pyecharts import options as opts
from pyecharts import faker
from pyecharts.datasets import

keys = ["襯衫", "羊毛衫", "雪紡衫", "褲子", "高跟鞋", "襪子"]
values = [5, 20, 36, 10, 75, 90]

# bar=(Bar()
#      .add_xaxis(keys)
#      .add_yaxis("商家A",values)
#      .set_global_opts(title_opts=opts.TitleOpts(title="主標題", subtitle="副標題"))
#      )
# bar.render()

def demo() -> Bar():
    c = (
        Bar()
            .add_xaxis(keys)
            .add_yaxis("商家A", values)
            .set_global_opts(title_opts=opts.TitleOpts(title="主標題", subtitle="副標題")))
    return c.render();
demo();
相關文章
相關標籤/搜索