diff --git a/dashboard.py b/dashboard.py index ef4b4b1..6996eb6 100644 --- a/dashboard.py +++ b/dashboard.py @@ -396,7 +396,7 @@ class TimeSeries(Widget): dt = (t_last - data[-5][0]) / 4 k = math.log((t_last - data[0][0]) / dt / n + 1) - max_value = max([d[1] for d in self.lts.data]) + max_value = max([d[3] if len(d) >= 4 else d[1] for d in self.lts.data]) max_value = max(max_value, 0.001) # ensure positive if self.yscale == "log": try: @@ -422,9 +422,17 @@ class TimeSeries(Widget): for i in range(n): t = data[i][0] v = data[i][1] + if len(data[i]) >= 4: + v_min = data[i][2] + v_max = data[i][3] + else: + v_min = data[i][1] + v_max = data[i][1] x = t2x(t) t_h = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(t)) y = v2y(v) + y_min = v2y(v_min) + y_max = v2y(v_max) #print(t, t_h, x) v_data.append( { @@ -432,6 +440,8 @@ class TimeSeries(Widget): "v": v, "x": x, "y": y, + "y_min": y_min, + "y_max": y_max, "color": self.criticalcolor(v), }) @@ -450,7 +460,8 @@ class TimeSeries(Widget): html += f"" html += f"{tm['v_h']}" for v in v_data: - html += f"" + html += f"" + html += f"" html += "" log.debug("len(html) = %s", len(html)) return Markup(html)