summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pages/machines.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pages/machines.py b/pages/machines.py
index 62bbfc0..5ec8956 100644
--- a/pages/machines.py
+++ b/pages/machines.py
@@ -108,7 +108,7 @@ def make_graph_location(days, date, satellites):
Input('machines-date', 'date'),
Input('machines-satellites', 'value')])
def make_graph_cpumodel(days, date, satellites):
- return make_graph(days, date, satellites, 'cpumodel', 'CPU', typ='bar', height=600)
+ return make_graph(days, date, satellites, 'cpumodel', 'CPU', typ='bar')
@app.callback(Output('machines-graph-realcores', 'figure'),
[Input('machines-days', 'value'),
@@ -129,7 +129,7 @@ def make_graph_ram(days, date, satellites):
Input('machines-date', 'date'),
Input('machines-satellites', 'value')])
def make_graph_systemmodel(days, date, satellites):
- return make_graph(days, date, satellites, 'systemmodel', 'System Model', typ='bar', height=600)
+ return make_graph(days, date, satellites, 'systemmodel', 'System Model', typ='bar')
@app.callback(Output('machines-graph-kvmstate', 'figure'),
[Input('machines-days', 'value'),
@@ -139,7 +139,7 @@ def make_graph_kvmstate(days, date, satellites):
return make_graph(days, date, satellites, 'kvmstate', 'KVM State')
-def make_graph(days, date, satellites, prop, title, unit='', typ='pie', height=450):
+def make_graph(days, date, satellites, prop, title, unit='', typ='pie'):
dbcon = db.getConnection()
cursor = dbcon.cursor()
@@ -181,7 +181,7 @@ def make_graph(days, date, satellites, prop, title, unit='', typ='pie', height=4
))
figure.update_layout(
title_text = title,
- height = height,
+ height = 450 if typ == 'pie' else max(20 * len(data) + 200,300),
yaxis_automargin=True
)
return figure