pyecharts设置全局配置项,通过set 您所在的位置:网站首页 pyecharts显示 pyecharts设置全局配置项,通过set

pyecharts设置全局配置项,通过set

2023-03-12 05:19| 来源: 网络整理| 查看: 265

pyecharts的全局配置项相关参数可进入其官方文档进行查看

https://pyecharts.org/#/zh-cn/global_options

下面以折线图为例,使用set_global_opts设置全局配置

from pyecharts.charts import Line from pyecharts.options import TitleOpts, LegendOpts, ToolboxOpts, VisualMapOpts line=Line() line.add_xaxis(["小铭","小红"])#添加x轴上信息 line.add_yaxis("资金",[10,20])#添加y轴上信息 #设置全局配置项 line.set_global_opts( title_opts=TitleOpts(title="测试",pos_left="center",pos_bottom="1%"),#标题配置项 legend_opts=LegendOpts(is_show=True),#图例配置项 toolbox_opts=ToolboxOpts(is_show=True),#提示框配置项 visualmap_opts=VisualMapOpts(is_show=True)#视觉映射配置项 ) line.render()#得到一个html文件

下面是效果

 此外,还有区域缩放配置项等



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有