Extend linear time scale

This commit is contained in:
Peter J. Holzer 2023-01-26 21:27:21 +01:00 committed by Peter J. Holzer
parent 75ce29135c
commit 5dbe0391dd
1 changed files with 5 additions and 1 deletions

View File

@ -307,7 +307,11 @@ class TimeSeries(Widget):
if self.yscale == "linear":
log.debug("")
if unit == "s" and max_value > 3600:
if max_value >= 4 * 7 * 86400:
if max_value >= 16 * 7 * 86400:
step = 4 * 7 * 86400
step_d = 4
unit = "w"
elif max_value >= 4 * 7 * 86400:
step = 7 * 86400
step_d = 1
unit = "w"