zoukankan      html  css  js  c++  java
  • pyecharts 简单使用

    def plotlib_data(self):  # 画图   Type   Proportion(%)
        self.cursor.execute('select video_name from game_fps GROUP BY video_name')
        video_name = [i[0] for i in self.cursor.fetchall()]
        self.cursor.execute('select number from game_fps GROUP BY number')
        x = [i[0] / 50 for i in self.cursor.fetchall()]
        self.cursor.execute('select fps from game_fps where video_name="{}"'.format(video_name[0]))
        y1 = [i[0] for i in self.cursor.fetchall()]
        self.cursor.execute('select fps from game_fps where video_name="{}"'.format(video_name[1]))
        y2 = [i[0] for i in self.cursor.fetchall()]
        line_fps = (
            Line()
                .add_xaxis(xaxis_data=x)
                .add_yaxis(series_name=video_name[0], y_axis=y1, is_smooth=True)
                .add_yaxis(series_name=video_name[1], y_axis=y2, is_smooth=True)
                .set_global_opts(title_opts=opts.TitleOpts(title="fps-ping"), xaxis_opts=opts.AxisOpts(name='fps', name_location='center', name_gap=35, name_textstyle_opts=opts.TextStyleOpts(font_size=25)))
                .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
        )
    
        self.cursor.execute('select ping from game_fps where video_name="{}"'.format(video_name[0]))
        y1 = [i[0] for i in self.cursor.fetchall()]
        self.cursor.execute('select ping from game_fps where video_name="{}"'.format(video_name[1]))
        y2 = [i[0] for i in self.cursor.fetchall()]
        line_ping = (
            Line()
                .add_xaxis(xaxis_data=x)
                .add_yaxis(series_name=video_name[0], y_axis=y1, is_smooth=True)
                .add_yaxis(series_name=video_name[1], y_axis=y2, is_smooth=True)
                .set_global_opts(title_opts=opts.TitleOpts(title=""), xaxis_opts=opts.AxisOpts(name='ping', name_location='center', name_gap=35, name_textstyle_opts=opts.TextStyleOpts(font_size=25)))
                .set_series_opts(label_opts=opts.LabelOpts(is_show=False))  # 不现实具体数字
        )
    
        grid = (
            Page(layout=Page.SimplePageLayout)
                .add(line_fps)
                .add(line_ping)
                .render("data.html")
        )
    

      

  • 相关阅读:
    Python随笔之字典Dict
    Python随笔之列表List
    Python基础整理,懒得分类了,大家对付看看吧
    shell批量推送公钥脚本
    Xcode 切换target 之后打包失败
    百度导航sdk错误日志
    前端项目中去掉替换双引号
    taro3.x项目中引用taro-ui以及taro-iconfont-cli
    taro
    JS中some() every() forEach() map() filter()的区别
  • 原文地址:https://www.cnblogs.com/yoyo1216/p/14755819.html
Copyright © 2011-2022 走看看