• 将多个图表放在一个页面


    node2:/root/fenxi#cat k9.py 
    from pyecharts.faker import Faker
    from pyecharts import options as opts
    from pyecharts.charts import Funnel, Page
    from pyecharts import options as opts
    from pyecharts.charts import Gauge, Page
    
    
    from pyecharts.faker import Faker
    from pyecharts import options as opts
    from pyecharts.charts import Pie
    from pyecharts.faker import Faker
    from pyecharts import options as opts
    from pyecharts.charts import Bar
    from pyecharts.globals import ThemeType
    page = Page('k9.html')
    
    
    
    def bar_base1() -> Bar:
        c = (
             Bar(init_opts=opts.InitOpts(theme=ThemeType.ROMANTIC,width="900px",height="300px"))
            .add_xaxis(["AAA身份核查系统", "外部数据平台", "新柜面", "新核心系统", "信贷系统", "网银系统","国结系统","回单系统"])
            .add_yaxis("",[10,62,90,105,147,300,520,900])
            .set_series_opts(label_opts=opts.LabelOpts(position="right"))
            .set_global_opts(title_opts=opts.TitleOpts(title="交易超时或异常按业务系统占比", subtitle="我是副标题"))
            #.set_global_opts(legend_opts=opts.LegendOpts(item_height=5, item_width=5))
            #.set_global_opts(visualmap_opts=opts.VisualMapOpts(item_height=5))
            .reversal_axis()
        )
        return c
    
    def bar_base2() -> Bar:
        c = (
            Bar()
            .add_xaxis(["BBB身份核查系统", "外部数据平台", "新柜面", "新核心系统", "信贷系统", "网银系统"])
            .add_yaxis("",[1000,623,590,195,147,30])
            .set_series_opts(label_opts=opts.LabelOpts(position="right"))
            .set_global_opts(title_opts=opts.TitleOpts(title="超时或异常按业务系统占比", subtitle="我是副标题"))
            .reversal_axis()
        )
        return c
    
    from pyecharts.components import Table
    from pyecharts.options import ComponentTitleOpts
    
    
    def table_base() -> Table:
        table = Table()
        headers = ["City name", "Area", "Population", "Annual Rainfall"]
        rows = [
            ["Brisbane", 5905, 1857594, 1146.4],
            ["Adelaide", 1295, 1158259, 600.5],
            ["Darwin", 112, 120900, 1714.7],
            ["Hobart", 1357, 205556, 619.5],
            ["Sydney", 2058, 4336374, 1214.8],
            ["Melbourne", 1566, 3806092, 646.9],
            ["Perth", 5386, 1554769, 869.4],
        ]
        table.add(headers, rows).set_global_opts(
            title_opts=ComponentTitleOpts(title="Table-我是主标题",title_style={"style": "font-size: 18px; font-weight:bold;"},subtitle_style= {"style": "font-size: 10px;"})
        )
        print (dir(table))
        table.title_opts={"style": "font-size:59px; font-weight:bold;"}
        return table
    page.add(bar_base1())
    page.add(bar_base2())
    page.add(table_base())
    page.render("k9.html")
  • 相关阅读:
    Nightingale 加发邮件功能
    Centos7 系统进程解析
    Nightingale 夜莺监控系统 安装
    iptables:应用防火墙规则:ptables-restore: line xxx failed [失败]
    CAD2011卸载不干净 无法重装问题
    Make Globle HS 全局热备
    Swarm工具使用
    docker-registry构建私有的镜像仓库
    MySQL Replication
    javascript 设计模式之单例模式
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348641.html
Copyright © 2020-2023  润新知