A piece of code to get all the configuration item functions of pyechart

A piece of code to get all the configuration item functions of pyechart


Insert picture description here


Insert picture description here



from pyecharts.charts import Bar
from pyecharts import options as opts
# 内置主题类型可查看 pyecharts.globals.ThemeType
from pyecharts.globals import ThemeType


bar = (
    Bar(init_opts=opts.InitOpts(width="1700px",
                                height="750px",
                                page_title="造价四剑客",
                                theme=ThemeType.DARK),
        )
    .add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
    .add_yaxis("商家A", [5, 20, 36, 10, 75, 90])
    .add_yaxis("商家B", [15, 6, 45, 20, 35, 66])
    .set_global_opts(title_opts=opts.TitleOpts(title="商家销售汇总",subtitle="分类汇总"),
                     toolbox_opts=opts.ToolboxOpts(is_show=True,
                                                   feature=opts.ToolBoxFeatureOpts(
                                                       save_as_image=opts.ToolBoxFeatureSaveAsImageOpts(type_="jpeg",is_show=True),
                                                       data_zoom=opts.ToolBoxFeatureDataZoomOpts(is_show=True)),
                                                   ),
                     visualmap_opts=opts.VisualMapOpts(is_show=True),
                     brush_opts=opts.BrushOpts(brush_link='all'),
                     datazoom_opts=opts.DataZoomOpts(is_show=True),

                     tooltip_opts=opts.TooltipOpts(
                         is_show=True,
                         trigger="axis",
                         trigger_on="mousemove",
                         axis_pointer_type="cross",
                         border_color="#FF0000",
                         #background_color="#0FAFA0",

                         #is_always_show_content=True,
                         border_width=2),


                     #=opts.AxisOpts(is_show=True)
                     #axispointer_opts=opts.AxisLineOpts(is_show=True),
                     # xaxis_opts=opts.AxisOpts(is_show=False),
                     # yaxis_opts=opts.AxisOpts(is_show=False)
                     #下面没用,但是方法没错
                     # graphic_opts=opts.GraphicText(graphic_item=opts.GraphicItem(is_draggable=True,
                     #                                                             is_progressive=True,
                     #                                                             is_invisible=True,
                     #                                                             id_='all'))
                     # graphic_opts=opts.GraphicGroup(graphic_item=opts.GraphicItem(is_draggable=True),
                     #                                is_diff_children_by_name=True)
                     

                     )
    .set_series_opts(itemstyle_opts=opts.ItemStyleOpts(border_color="#0FAFA0",
                                                       #color="blue"
                                                       border_width=2,
                                                       #border_type="dashed"
                                                       area_color="green"
                                                      ),
                     #label_opts=opts.LabelOpts(is_show=True,rotate=45)
                     linestyle_opts=opts.LineStyleOpts(is_show=True,width=4,type_="dotted"),
                     #用不到#effect_opts=opts.Lines3DEffectOpts(is_show=True,period=1000),
                     #用不到#splitline_opts=opts.SplitLineOpts(is_show=True,linestyle_opts=opts.LineStyleOpts(is_show=True,width=8))
                     markpoint_opts=opts.MarkPointOpts(data=[
                         opts.MarkPointItem(name="中铁巅峰",
                                            type_="average",
                                            #coord=["羊毛衫",60]
                                            #value=32,
                                            ),
                         opts.MarkPointItem(coord=["羊毛衫",60],
                                           value=60),
                         opts.MarkPointItem(type_="max")

                     ]),
                     markline_opts=opts.MarkLineOpts(data=[
                         opts.MarkLineItem(type_="max")
                     ])
                     # markarea_opts=opts.MarkAreaOpts(data=[
                     #     opts.MarkAreaItem(type_=('max','min'))
                     # ])

                     #effect_opts=opts.EffectOpts(is_show=True,symbol=SymbolType.ARROW,symbol_size=5,color="yellow")
                     )

)
    #.set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题"))

bar.render("123.html")

Show results


Insert picture description here
Insert picture description here


Insert picture description here


Insert picture description here


Guess you like

Origin blog.csdn.net/XRTONY/article/details/114855621