zoukankan      html  css  js  c++  java
  • 参数传递

    参数传递
    pyecharts 对配置项基本上都采用 XXXOpts/XXXItems 以及 dict 两种数据形式,这两种是完全等价的。
    
    比如下面三者效果是一致的
    	
    	class InitOpts(BasicOpts):
        def __init__(
            self,
             str = "900px",
            height: str = "500px",
            chart_id: Optional[str] = None,
            renderer: str = RenderType.CANVAS,
            page_title: str = CurrentConfig.PAGE_TITLE,
            theme: str = ThemeType.WHITE,
            bg_color: Union[str, dict] = None,
            js_host: str = "",
            animation_opts: Union[AnimationOpts, dict] = AnimationOpts(),
        ):
            self.opts: dict = {
                "width": width,
                "height": height,
                "chart_id": chart_id,
                "renderer": renderer,
                "page_title": page_title,
                "theme": theme,
                "bg_color": bg_color,
                "js_host": js_host,
                "animationOpts": animation_opts,
            }
    		
    		
    		
    	c = Bar(init_opts=opts.InitOpts(width="620px", height="420px"))
    c = Bar(dict(width="620px", height="420px"))
    c = Bar({"width": "620px", "height": "420px"})
  • 相关阅读:
    twemproxy配置
    tomcat远程调试
    hadoop配置
    kafka原理分析
    hive-sql
    P1983 车站分级
    拓扑排序
    洛谷P1982 小朋友的数字
    字典树Trie
    城市交通费
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348630.html
Copyright © 2011-2022 走看看