From d6bdaa4128927c14b05a528699ebc06ba2ab68f2 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Fri, 30 Dec 2022 21:32:48 +0100 Subject: [PATCH] Don't try to render timeseries which are too short --- dashboard.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dashboard.py b/dashboard.py index 6fea2f2..fd389c9 100644 --- a/dashboard.py +++ b/dashboard.py @@ -152,6 +152,8 @@ class TimeSeries(Widget): data = self.lts.data n = len(data) t_last = data[-1][0] + if len(data) < 5: + return "(not enough data)" dt = (t_last - data[-5][0]) / 4 k = math.log((t_last - data[0][0]) / dt / n + 1)