zoukankan      html  css  js  c++  java
  • 将多个图表放在一个页面

    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")
  • 相关阅读:
    整型数字转utf8
    cmake构建时指定编译器架构(x86 or x64)
    tcp echo server libuv
    VS2015编译boost1.62
    android rom开发
    游戏昵称
    乐观锁和悲观锁
    数据库锁机制
    MySQL事务实现原理
    MySQL事务
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348641.html
Copyright © 2011-2022 走看看