pyecharts探索

官方文档:http://pyecharts.org/#/zh-cn/

终于找到一个能用的demo,待完善

 1 # coding=utf-8
 2 from pyecharts.charts import Bar
 3 from pyecharts import options as opts
 4 from pyecharts import faker
 5 # from pyecharts.datasets import
 6 
 7 keys = ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
 8 values = [5, 20, 36, 10, 75, 90]
 9 
10 # bar=(Bar()
11 #      .add_xaxis(keys)
12 #      .add_yaxis("商家A",values)
13 #      .set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题"))
14 #      )
15 # bar.render()
16 
17 def demo() -> Bar():
18     c = (
19         Bar()
20             .add_xaxis(keys)
21             .add_yaxis("商家A", values)
22             .set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题")))
23     return c.render();
24 demo()

 

posted @ 2020-07-03 19:57  玉北  阅读(172)  评论(0编辑  收藏  举报