Plot every 2nd datapoint in attempt to reduce file size

This commit is contained in:
Peter Stockings
2023-01-23 20:30:56 +11:00
parent 48a7a009e8
commit 6f5b76ac64

4
app.py
View File

@@ -70,8 +70,8 @@ def overview():
graph = pygal.Line(show_y_guides=False,
show_legend=False, style=custom_style)
graph.x_labels = [c['logged_at'] for c in cadences]
graph.add('RPM', [c['rpm'] for c in cadences])
graph.x_labels = [c['logged_at'] for c in cadences[::2]]
graph.add('RPM', [c['rpm'] for c in cadences[::2]])
graph_data = graph.render_data_uri()
return render_template('overview.html', last_cadence=last_cadence, cadences=cadences[-15:], graph_data=graph_data)