猫史档案馆


【Python作品分享】喵统计【作品秀】

用户:玄离俊秀的狼王玄离俊秀的狼王查看:3 回复:2 评论:3 创建时间:2020-04-14T18:44:41


【作品展示】

center_image

 

【作品介绍】

只是一个绘图的

 

【作品源代码】

import os
import webbrowser
from pyecharts import Bar, Line, Pie
import json


def plots(type):
    attr = ["喵", "疑似病例", "喵亡病例", "治愈病例"]
    value = [82455, 168, 3311, 75937]

    

    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"))


if __name__ == '__main__':
    plots("柱状图")

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
玄离俊秀的狼王玄离俊秀的狼王

说一下那个喵神t

点赞0


评论


FliexFliex

emotion_编程猫_点赞

点赞0


评论