From 255f4d721c2fbbb5b4c1403f9b9d37f373a68ef8 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Mon, 22 Feb 2021 07:59:51 +0100 Subject: [PATCH] Add statistics to sidebar Fix stupid mistake --- frontend/templates/frontend/sidebar.html | 7 +++++++ mood/statistics.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/templates/frontend/sidebar.html b/frontend/templates/frontend/sidebar.html index 8907483..c0ce3a9 100644 --- a/frontend/templates/frontend/sidebar.html +++ b/frontend/templates/frontend/sidebar.html @@ -55,6 +55,13 @@ Notifications + + + diff --git a/mood/statistics.py b/mood/statistics.py index 29d3a9e..d22c172 100644 --- a/mood/statistics.py +++ b/mood/statistics.py @@ -50,7 +50,7 @@ def moodstats(user, mindate=None, maxdate=None, days=7): line = hv.Curve(pointtuples) maxval = Mood.objects.filter(user=user).latest("value").value - maxy = maxval + min(maxval * 0.1, 1) + maxy = maxval + max(maxval * 0.1, 1) maxx = maxdate.timestamp() * 1000 minx = maxx - (60*60*24*7) * 1000