Plot live cadence data

This commit is contained in:
Peter Stockings
2023-01-22 20:01:26 +11:00
parent aa82db6678
commit f35c30aeb1
2 changed files with 20 additions and 2 deletions

9
app.py
View File

@@ -53,7 +53,14 @@ def home():
def overview():
cadences = db.get_all_cadences()
last_cadence = cadences[-1]['rpm']
return render_template('overview.html', last_cadence=last_cadence, cadences=cadences)
plot = {
"x": [c['logged_at'] for c in cadences],
"y": [c['rpm'] for c in cadences],
"type": 'scatter'
}
return render_template('overview.html', last_cadence=last_cadence, plot=plot, cadences=cadences)
if __name__ == '__main__':