Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 856 Bytes

bar_markline_type.md

File metadata and controls

30 lines (25 loc) · 856 Bytes

pyecharts 代码 / 效果

from pyecharts import options as opts
from pyecharts.charts import Bar
from pyecharts.faker import Faker

c = (
    Bar()
    .add_xaxis(Faker.choose())
    .add_yaxis("商家A", Faker.values())
    .add_yaxis("商家B", Faker.values())
    .set_global_opts(title_opts=opts.TitleOpts(title="Bar-MarkLine(指定类型)"))
    .set_series_opts(
        label_opts=opts.LabelOpts(is_show=False),
        markline_opts=opts.MarkLineOpts(
            data=[
                opts.MarkLineItem(type_="min", name="最小值"),
                opts.MarkLineItem(type_="max", name="最大值"),
                opts.MarkLineItem(type_="average", name="平均值"),
            ]
        ),
    )
    .render("bar_markline_type.html")
)
<iframe width="100%" height="800px" src="Bar/bar_markline_type.html"></iframe>