1 2 3 4 5 6 7 8 9 10 11 12 13 14
| from pyecharts import options as opts from pyecharts.charts import Pie from pyecharts.faker import Faker
list1 = [list(z) for z in zip(Faker.choose(), Faker.values())] print(list1) c = ( Pie() .add("",list1 ) .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} ({d}%)")) .render("饼图的绘制.html") )
|