首页 > 其他 > 详细

pyecharts 学习笔记(5)

时间:2020-06-02 16:42:44      阅读:165      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 

 pyecharts 提供十分丰富的工具来是的展示更加完美。

接下来就是分别介绍不能功能函数的使用了

 

1. TitleOpts: 标题配置项

 

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

(
    Bar()
    .add_xaxis(
        [
            "名字很长的X轴标签1",
            "名字很长的X轴标签2",
            "名字很长的X轴标签3",
            "名字很长的X轴标签4",
            "名字很长的X轴标签5",
            "名字很长的X轴标签6",
        ]
    )
    .add_yaxis("商家A", [10, 20, 30, 40, 50, 40])
    .add_yaxis("商家B", [20, 10, 40, 30, 40, 50])
    .set_global_opts(
        xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-15)),
        title_opts=opts.TitleOpts(title="Bar-旋转X轴标签", subtitle="解决标签名字过长的问题"),
    )
    .render_notebook()
)

技术分享图片

 

 

 

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


(
    Bar()
    .add_xaxis(Faker.choose())
    .add_yaxis("商家A", Faker.values())
    .add_yaxis("商家B", Faker.values())
    .set_global_opts(
        title_opts=opts.TitleOpts(title="Bar-Brush示例", subtitle="我是副标题"),
        brush_opts=opts.BrushOpts(),# 厉害的工具
    )
    .render_notebook()#"bar_with_brush.html"
)

技术分享图片

 

pyecharts 学习笔记(5)

原文:https://www.cnblogs.com/vincent-sh/p/13031557.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!