|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
from pyecharts import options as opts
from pyecharts.charts import Pie
from pyecharts.faker import Faker
pie=(
Pie()
.add(
series_name="广东GDP",
data_pair=[("深圳",26927),("广州",23628),("佛山",10751),("东莞",9482),("惠州",4177),("珠海",3435),("茂名",3252)],
radius=[30,60],
)
.set_global_opts(
title_opts=opts.TitleOpts(title="环状图案例")
legend_opts=opts.LegendOpts(orient="vertical", pos_top="15%", pos_left="2%"),
# 上面一行被报错
)
.set_colors(["blue", "green", "yellow", "red", "pink", "orange", "purple"]]
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
.render("pie_radius.html")
)
|
|