Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 614 Bytes

timeline_multi_axis.md

File metadata and controls

23 lines (18 loc) · 614 Bytes

pyecharts 代码 / 效果

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

tl = Timeline()
for i in range(2015, 2020):
    bar = (
        Bar()
        .add_xaxis(Faker.choose())
        .add_yaxis("商家A", Faker.values())
        .add_yaxis("商家B", Faker.values())
        .set_global_opts(title_opts=opts.TitleOpts("某商店{}年营业额".format(i)))
    )
    tl.add(bar, "{}年".format(i))
tl.render("timeline_multi_axis.html")
<iframe width="100%" height="800px" src="Timeline/timeline_multi_axis.html"></iframe>