本文共 911 字,大约阅读时间需要 3 分钟。
fromexample.commons import Fakerfrom pyecharts import options asoptsfrompyecharts.charts import Page, Pie
l1= ['aa','bb','cc','dd','ee']num=[10,20,15,25,30]c=(
Pie()
.add(
"",[list(z) for z in zip(l1, num)],
radius=["40%", "55%"],
label_opts=opts.LabelOpts(
position="outside",
formatter="{a|{a}}{abg|}
{hr|}
{b|{b}: }{c} {per|{d}%} ",
background_color="#eee",
border_color="#aaa",
border_width=1,
border_radius=4,
rich={
"a": {"color": "#999", "lineHeight": 22, "align": "center"},
"abg": {
"backgroundColor": "#e3e3e3",
"width": "100%",
"align": "right",
"height":22,
"borderRadius":[4, 4, 0, 0],
},
"hr": {
"borderColor": "#aaa",
"width": "100%",
"borderWidth":0.5,
"height":0,
},
"b": {"fontSize":16, "lineHeight": 33},
"per": {
"color": "#eee",
"backgroundColor": "#334455",
"padding":[2, 4],
"borderRadius":2,
},
},
),
)
.set_global_opts(title_opts=opts.TitleOpts(title="Pie-富文本示例"))
)
c.render_notebook()
转载地址:https://blog.csdn.net/weixin_32631179/article/details/112844494 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!