Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 573 Bytes

pie_set_color.md

File metadata and controls

20 lines (15 loc) · 573 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())])
    .set_colors(["blue", "green", "yellow", "red", "pink", "orange", "purple"])
    .set_global_opts(title_opts=opts.TitleOpts(title="Pie-设置颜色"))
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
    .render("pie_set_color.html")
)
<iframe width="100%" height="800px" src="Pie/pie_set_color.html"></iframe>