pyecharts v1 版本 学习笔记 饼图,玫瑰图
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了pyecharts v1 版本 学习笔记 饼图,玫瑰图,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1902字,纯文字阅读大概需要3分钟。
内容图文

饼图:
普通案例
from example.commons import Faker from pyecharts import options as opts from pyecharts.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)]) .set_global_opts(title_opts=opts.TitleOpts(title="Pie-基本示例")) .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}")) ) c.render_notebook()
圆环图:
from example.commons import Faker from pyecharts import options as opts from pyecharts.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%", "75%"], # 圆环的粗细和大小 ) .set_global_opts( title_opts=opts.TitleOpts(title="Pie-Radius"), legend_opts=opts.LegendOpts( orient="vertical", pos_top="5%", pos_left="2%" # 左面比例尺 ), ) .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}")) ) c.render_notebook()
圆环显示百分比
from example.commons import Faker from pyecharts import options as opts from pyecharts.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|}\n{hr|}\n {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://www.cnblogs.com/baili-luoyun/p/11061207.html
内容总结
以上是互联网集市为您收集整理的pyecharts v1 版本 学习笔记 饼图,玫瑰图全部内容,希望文章能够帮你解决pyecharts v1 版本 学习笔记 饼图,玫瑰图所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。
来源:【匿名】