當前位置: 首頁>>代碼示例>>Python>>正文


Python pyecharts.Line方法代碼示例

本文整理匯總了Python中pyecharts.Line方法的典型用法代碼示例。如果您正苦於以下問題:Python pyecharts.Line方法的具體用法?Python pyecharts.Line怎麽用?Python pyecharts.Line使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyecharts的用法示例。


在下文中一共展示了pyecharts.Line方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_echarts_instance

# 需要導入模塊: import pyecharts [as 別名]
# 或者: from pyecharts import Line [as 別名]
def get_echarts_instance(self, **kwargs):
        t_data = models.TemperatureRecord.objects.all().order_by('create_time').values_list('high', 'create_time')
        hs, ds = zip(*t_data)
        line = Line('High Temperature')
        line.add('High', ds, hs)
        return line 
開發者ID:kinegratii,項目名稱:django-echarts,代碼行數:8,代碼來源:backend_views.py

示例2: Line_network

# 需要導入模塊: import pyecharts [as 別名]
# 或者: from pyecharts import Line [as 別名]
def Line_network(d, title, title1, date, network_in, network_put):
    bar = Line(d, width=1600, height=500)
    bar.add(title, date, network_in,is_datazoom_show=True)
    bar.add(title1, date, network_put,is_datazoom_show=True)
    return bar 
開發者ID:hequan2017,項目名稱:autoops,代碼行數:7,代碼來源:views.py

示例3: line_chart

# 需要導入模塊: import pyecharts [as 別名]
# 或者: from pyecharts import Line [as 別名]
def line_chart():
    sale = db.session.query(func.count(extract('Day', sales.sales_addtime)),
                         extract('Day', sales.sales_addtime)).group_by(
        extract('Day', sales.sales_addtime)
    ).all()
    attr = [i for _,i in sale]
    v1 = [j for j,_ in sale]
    print(attr)
    print(v1)
    line = Line("日銷售量")

    line.add("", attr, v1, is_stack=True, is_smooth=True,is_fill=True)
    return line 
開發者ID:agamgn,項目名稱:flask-Purchase_and_sale,代碼行數:15,代碼來源:uilt.py

示例4: alarm_report

# 需要導入模塊: import pyecharts [as 別名]
# 或者: from pyecharts import Line [as 別名]
def alarm_report():
    try:
        INFOS = []
        total_key = 'op_totals_alarms_tmp'
        def counts_alarm(key,total_key = None):
            vals = []
            for i in range(7):
                count_key = 'op_counts_alarms_tmp'
                data_now = datetime.datetime.now() - datetime.timedelta(days=i)
                dd = data_now.strftime('%Y-%m-%d')
                alarm_count_key = '%s_%s' %(key,dd)
                if RC_CLUSTER.exists(alarm_count_key):
                    vals = RC_CLUSTER.hgetall(alarm_count_key)
                    vals = sorted(vals.items(), key=lambda item: int(item[1]))
                    for val in vals:
                        RC_CLUSTER.hincrby(count_key,val[0],val[1])
                        if total_key:
                            RC_CLUSTER.hincrby(total_key,dd, val[1])
            if RC_CLUSTER.exists(count_key):
                vals = RC_CLUSTER.hgetall(count_key)
                RC_CLUSTER.delete(count_key)
                vals = sorted(vals.items(), key=lambda item: int(item[1]),reverse=True)
            if len(vals) >10:
                return vals[:10]
            else:
                return vals
        alarm_count = counts_alarm('op_business_alarm_count',total_key=total_key)
        vals = counts_alarm('op_business_alarm_perf')
        if vals:
            pie_perf = Pie("近7天報警接口性能統計TOP10", width='100%', height='100%', title_pos='center', title_text_size=14)
            attrs = [val[0] for val in vals]
            vals = [int(val[1]) for val in vals]
            pie_perf.add("", attrs, vals, is_label_show=True, is_toolbox_show=False,legend_orient='vertical',legend_pos='left', xaxis_interval=0, is_random=True,rosetype = 'area')
            INFOS.append(pie_perf)
        vals = counts_alarm('op_business_alarm_busi')
        if vals:
            pie_busi = Pie("近7天報警業務歸屬統計TOP10", width='100%', height='100%', title_pos='center', title_text_size=14)
            attrs = [val[0] for val in vals]
            vals = [int(val[1]) for val in vals]
            pie_busi.add("", attrs, vals, is_label_show=True, is_toolbox_show=False,legend_orient='vertical',legend_pos='left',xaxis_interval=0, is_random=True,rosetype = 'radius',radius=[35, 75])
            INFOS.append(pie_busi)
        if RC_CLUSTER.exists(total_key):
            vals = RC_CLUSTER.hgetall(total_key)
            vals = sorted(vals.items(), key=lambda item: item[0],reverse=True)
            RC_CLUSTER.delete(total_key)
            line = Line("近7天業務接口每日報警統計", width='100%', height='100%', title_pos='center', title_text_size=14)
            attrs = [val[0] for val in vals]
            vals = [int(val[1]) for val in vals]
            line.add("", attrs, vals, is_label_show=True, is_toolbox_show=False,is_legend_show  = False, xaxis_interval=0, is_random=True)
            INFOS.append(line)
    except Exception as e:
        logging.error(e)
        return redirect(url_for('error'))
    return render_template('alarm_report.html',INFOS=INFOS,alarm_count=alarm_count) 
開發者ID:wylok,項目名稱:sparrow,代碼行數:56,代碼來源:report.py


注:本文中的pyecharts.Line方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。