关于pyecharts的相关属性的测试

it2026-06-05  2

不设置任何属性的 

去掉图例 

pie.set_global_opts(title_opts=opts.TitleOpts( title='饼图示例' ) ,legend_opts=opts.LegendOpts( is_show=False#设置图例是否显示 ) )

 图例居左,表里居中

pie.set_global_opts(title_opts=opts.TitleOpts( title='饼图示例', pos_left="center"#标题居中 ) ,legend_opts=opts.LegendOpts( # is_show=False#设置图例是否显示 orient="vertical",#图例垂直显示 pos_left="0"#距左边界距离,pos_right 右 pos_top 上 pos_bottom 下 # ) )

 

去掉各个部分的标签

 

pie.set_series_opts( tooltip_opts=opts.TooltipOpts( trigger="item", formatter="{a} <br/>{b}: {c} ({d}%)"#按百分比显示 ) ,label_opts=opts.LabelOpts( is_show=False#去掉各个部分的标签 ) )

 

未显示属性,后续添加。 

参考链接:https://zhuanlan.zhihu.com/p/111330795

最新回复(0)