1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| c = (Pie().add("", [list(z) for z in zip(["古装", "其他"], [35, 65])], center=["20%", "30%"], radius=[50, 80], ) .add( "", [list(z) for z in zip(["动作", "其他"],[24, 76])], center=["55%", "30%"], radius=[50, 80], ) .add( "", [list(z) for z in zip(["爱情", "其他"],[10, 90])], center=["20%", "70%"], radius=[50, 80], label_opts=opts.LabelOpts(is_show=True), ) .add( "", [list(z) for z in zip(["惊悚", "其他"],[20, 80])], center=["55%", "70%"], radius=[50, 80], label_opts=opts.LabelOpts(is_show=True), ) .set_global_opts( title_opts=opts.TitleOpts(title="Pie-多饼图基本示例"), legend_opts=opts.LegendOpts( type_="scroll", pos_top="30%", pos_left="70%", orient="vertical" ), ) ) c.render_notebook() c.render('2.html')
|