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")
  • 相关阅读:
    Flex 开源框架及工具 枫
    String.Format格式说明 枫
    HTTP服务器状态代码定义(Status Code Definitions) 枫
    像素对应表 枫
    js各种获取屏幕高度宽度 枫
    c#正则表达式帮助 枫
    使用模板引擎Trimpath 枫
    分布式缓存HttpRuntime.cache应用到单点登陆中_优化登陆 枫
    Query this 和 $(this) 的区别 枫
    css and js style 枫
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348641.html
Copyright © 2011-2022 走看看