bug fix with layout

community
Steve L. Nyemba 6 years ago
parent 368c73a120
commit 37f0ea7de7

@ -1102,8 +1102,8 @@ def prepare_plot(id):
# X.append(np.random.choice(100,4).tolist()) # X.append(np.random.choice(100,4).tolist())
q = [{"info":"Monitoring RAM consumption trends","ylabel":"% used","node":node,"x":XRAM,"labels":np.arange(1,xn).tolist(),"series":names,"title":"RAM Usage"}] q = [{"info":"Monitoring RAM consumption trends","ylabel":"% used","node":node, "x":XRAM,"labels":np.arange(1,xn).tolist(),"series":names,"title":"RAM Usage"}]
q.append({"info":"Monitoring CPU consumption trends","ylabel":"% used","node":node,"x":XCPU,"labels":np.arange(1,xn_).tolist(),"series":names,"title":"CPU Usage"}) q.append({"info":"Monitoring CPU consumption trends","ylabel":"% used","node":node,"type":"bar","x":XCPU,"labels":np.arange(1,xn_).tolist(),"series":names,"title":"CPU Usage"})
key = 'app.trend.'+node key = 'app.trend.'+node
session[key] = q session[key] = q
return (key,200) return (key,200)
@ -1120,14 +1120,16 @@ def get_charts(format,id,key):
series = ['series_1'] series = ['series_1']
args = session[key] args = session[key]
if isinstance(args,list) and 'index' in request.args: if isinstance(args,list) is False:
index = int(request.args['index'])
args = args[index]
args['remove'] = remove args['remove'] = remove
info = [Graph.instance(format,id,**args)] info = [Graph.instance(format,id,**args)]
else: else:
# print args # print args
info = [ Graph.instance(format,id, **dict(item,**{'remove':remove})) for item in args] info = [ Graph.instance(format,id, **dict(item,**{'remove':remove})) for item in args]
if 'index' in request.args :
index = int(request.args['index'])
args = args[index]
# if remove is not None : # if remove is not None :
# args['remove'] = remove # args['remove'] = remove

@ -150,5 +150,9 @@ class HTMLGraph(Graph):
dataset = {"label":name,"fill":False,"backgroundColor":Graph.COLORS[index],"borderColor":Graph.COLORS[index],"data":row} dataset = {"label":name,"fill":False,"backgroundColor":Graph.COLORS[index],"borderColor":Graph.COLORS[index],"data":row}
config["data"]["datasets"].append(dataset) config["data"]["datasets"].append(dataset)
if 'type' in self.args :
config['type'] = self.args['type']
else :
config['type'] = 'line'
return config return config

Loading…
Cancel
Save