Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 666 Bytes

timeline_pie.md

File metadata and controls

27 lines (22 loc) · 666 Bytes

pyecharts 代码 / 效果

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

attr = Faker.choose()
tl = Timeline()
for i in range(2015, 2020):
    pie = (
        Pie()
        .add(
            "商家A",
            [list(z) for z in zip(attr, Faker.values())],
            rosetype="radius",
            radius=["30%", "55%"],
        )
        .set_global_opts(title_opts=opts.TitleOpts("某商店{}年营业额".format(i)))
    )
    tl.add(pie, "{}年".format(i))
tl.render("timeline_pie.html")
<iframe width="100%" height="800px" src="Timeline/timeline_pie.html"></iframe>