添加红色文字配置
def pie_base(attr, list_num, title) -> Pie:
s = [list(z) for z in zip(attr, list_num)]
pie = (Pie(init_opts=opts.InitOpts(
animation_opts=opts.AnimationOpts(
animation_delay=500, animation_easing="cubicOut", animation = False
)))
.add("", s)
.set_global_opts(title_opts=opts.TitleOpts(title=title), legend_opts=opts.LegendOpts(type_="scroll", pos_left="right", orient="vertical"))
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}", is_show=True))
)
return pie