本文整理汇总了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
示例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
示例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
示例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)