用户:惘風查看:0 回复:1 评论:0 创建时间:2019-12-07T00:54:55
【作品展示】

【作品介绍】
可以改一改value里的数据试试哦O(∩_∩)O
【作品源代码】
#温馨提示:运行之前要保存哦。
import os
import webbrowser
from pyecharts import Bar, Line, Pie
#输入数据
attr = ['衬衫','羊毛衫','雪纺衫','高跟鞋','袜子']
value = [11,12,13,10,10,10]
if type == '柱状图':
chart = Bar('柱状图数据')
elif type == '折线图':
chart = Line('折线图数据')
elif type == '饼状图':
chart = Pie('饼状图数据')
#打开网页
chart.add(type, attr, value)
chart.render()
webbrowser.open('file://' + os.path.realpath('render.html'))
#在type' '中输入:柱状图 或 饼状图 或 折线图 试试吧>_<
if __name__ == '__main__':
plots(data_file='data.json',type='柱状图')
#温馨提示:运行之前要保存哦。
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn