pyecharts绘制饼图
from pyecharts.charts import Pie
from pyecharts import options as opts
months = ["不限", "博士", "大专", "本科", "硕士"]
data = [125903, 1733, 91766, 548738, 100301]
pie = (Pie()
.add("", [list(z) for z in zip(months, data)])
.set_global_opts(
title_opts=opts.TitleOpts(title="学历与职位要求的数量", pos_left="center"),
legend_opts=opts.LegendOpts(orient="vertical", pos_left="left"),
toolbox_opts=opts.ToolboxOpts(),
)
.set_series_opts(
label_opts=opts.LabelOpts(formatter="{b}: {d}%")
)
)
pie.render("pie.html")
效果展示: