pyecharts 实例1

from pyecharts.charts import Bar              #图像 X轴 Y轴
from pyecharts import options as opts          #标题 工具
from pyecharts.globals import ThemeType         #背景颜色


bar = Bar(init_opts=opts.InitOpts(theme=ThemeType.CHALK))
bar.add_xaxis(['苹果','香蕉','西瓜','橘子'])
bar.add_yaxis('水果',[50,50,60,30])

bar.set_global_opts(title_opts= opts.TitleOpts(title='柱状图示列',pos_left="center",pos_bottom="1%"),
                    toolbox_opts=opts.ToolboxOpts(  # 添加工具箱
                        is_show=True,  # 是否显示工具箱
                        orient="horizontal",  # 工具箱方向,可选 "horizontal" 或 "vertical"
                        pos_left="center",  # 工具箱位置
                        feature=opts.ToolBoxFeatureOpts(  # 工具箱功能配置
                            save_as_image=opts.ToolBoxFeatureSaveAsImageOpts(is_show=True),  # 保存为图片
                            restore=opts.ToolBoxFeatureRestoreOpts(is_show=True),  # 重置
                            data_view=opts.ToolBoxFeatureDataViewOpts(is_show=True),  # 数据视图
                            magic_type=opts.ToolBoxFeatureMagicTypeOpts(is_show=True),  # 动态类型切换
                            data_zoom=opts.ToolBoxFeatureDataZoomOpts(is_show=True),  # 数据
                        )
                    )
                    )

bar.render()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值