当前位置:   article > 正文

Python 使用pyecharts生成echarts图像_pyecharts生成图片

pyecharts生成图片

其实要实现起来官网上有比较详细的说明

地址:渲染图片 - pyecharts - A Python Echarts Plotting Library built with love.

首先安装包:

  1. pip install pyecharts
  2. pip install snapshot_phantomjs

然后代码这样:

  1. from pyecharts import options as opts
  2. from pyecharts.charts import Bar
  3. from pyecharts.render import make_snapshot
  4. from snapshot_phantomjs import snapshot
  5. def bar_chart() -> Bar:
  6. c = (
  7. Bar()
  8. .add_xaxis(["衬衫", "毛衣", "领带", "裤子", "风衣", "高跟鞋", "袜子"])
  9. .add_yaxis("商家A", [114, 55, 27, 101, 125, 27, 105])
  10. .add_yaxis("商家B", [57, 134, 137, 129, 145, 60, 49])
  11. .reversal_axis()
  12. .set_series_opts(label_opts=opts.LabelOpts(position="ri
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/918575
推荐阅读
相关标签
  

闽ICP备14008679号