码迷,mamicode.com
首页 > 编程语言 > 详细

python之pyecharts

时间:2021-01-07 12:36:15      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:调用   ble   title   技术   htm   https   chrome   sel   har   

  文档:https://pyecharts.org/

安装:

  

pip install pyecharts

 

示例:

from pyecharts.charts import Bar
from pyecharts import options as opts

# V1 版本开始支持链式调用
# 你所看到的格式其实是 `black` 格式化以后的效果
# 可以执行 `pip install black` 下载使用
bar = (
    Bar()
    .add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
    .add_yaxis("商家A", [5, 20, 36, 10, 75, 90])
    .set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题"))
    # 或者直接使用字典参数
    # .set_global_opts(title_opts={"text": "主标题", "subtext": "副标题"})
)
bar.render()

# 不习惯链式调用的开发者依旧可以单独调用方法
bar = Bar()
bar.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
bar.add_yaxis("商家A", [5, 20, 36, 10, 75, 90])
bar.set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题"))
bar.render()

 

 

 

 

常见问题:

  1.使用snapshot_selenium渲染图片的时候,发生错误

selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to

  解决:

    原因是Chrome浏览器需要配置chromedriver

    1)打开浏览器输入chrome://version/ 查看chrome版本,

技术图片

 

     2)访问网址:http://chromedriver.storage.googleapis.com/index.html  选择合适版本的driver, 下载即可

    3)下载完成之后, 解压文件到python的根目录下即可

 

 

 

 

 

 

 

 

  

python之pyecharts

标签:调用   ble   title   技术   htm   https   chrome   sel   har   

原文地址:https://www.cnblogs.com/xingxia/p/14237636.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!