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

      

  • 相关阅读:
    Logistic Regression
    Bootstrap研究2布局系统杂记
    《Programming in Scala》读书笔记(持续更新) passover的个人空间 DOIT博客 多易网
    《Scala, Erlang, F#作者讨论函数式语言》有感
    用python抓取oj题目(0)——重回战场 duoduo3_69 博客园
    Netty vs Apache MINA
    What is Akka?
    Fault Tolerance (Scala) — Akka Documentation
    execute phase · mrdon/mavencliplugin Wiki
    netty和mina的比较
  • 原文地址:https://www.cnblogs.com/yoyo1216/p/14755819.html
Copyright © 2011-2022 走看看