0
点赞
收藏
分享

微信扫一扫

pyecharts第二节、饼图

ZGtheGreat 2022-03-11 阅读 49


创建一个新的类作为饼图测试

pyecharts第二节、饼图_html

输入类名【demo2.py】

pyecharts第二节、饼图_饼图_02

 输入以下编码:

from pyecharts import Pie
attr =["Java", "C++", "Python", ".Net", "PHP", "Go"]
v1 =[30, 20, 25, 10, 10, 5]
pie =Pie("流行语言占比")
pie.add("", attr, v1, is_label_show=True)
pie.show_config()
pie.render()

生成的【render.html】会替换掉之前的文件 

pyecharts第二节、饼图_echarts_03 

 直接鼠标右键->【Open In】->【Explorer】

pyecharts第二节、饼图_python_04

双击打开即可

pyecharts第二节、饼图_echarts_05

效果图如下: 

pyecharts第二节、饼图_echarts_06

 饼图挺简单的。

希望能对大家有所帮助,欢迎一键三连。


举报

相关推荐

0 条评论