Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 613 Bytes

pie_position.md

File metadata and controls

26 lines (21 loc) · 613 Bytes

pyecharts 代码 / 效果

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

c = (
    Pie()
    .add(
        "",
        [list(z) for z in zip(Faker.choose(), Faker.values())],
        center=["35%", "50%"],
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(title="Pie-调整位置"),
        legend_opts=opts.LegendOpts(pos_left="15%"),
    )
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
    .render("pie_position.html")
)
<iframe width="100%" height="800px" src="Pie/pie_position.html"></iframe>