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())
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 = [{"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,"type":"bar","x":XCPU,"labels":np.arange(1,xn_).tolist(),"series":names,"title":"CPU Usage"})
key = 'app.trend.'+node
session[key] = q
return (key,200)
@ -1120,14 +1120,16 @@ def get_charts(format,id,key):
series = ['series_1']
args = session[key]
if isinstance(args,list) and 'index' in request.args:
index = int(request.args['index'])
args = args[index]
if isinstance(args,list) is False:
args['remove'] = remove
info = [Graph.instance(format,id,**args)]
else:
# print 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 :
# args['remove'] = remove

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

Loading…
Cancel
Save