From c6d8f3f3f5b27ad8e23e5fd73184c2769fc7b4e4 Mon Sep 17 00:00:00 2001 From: dodoradio Date: Sun, 23 Jul 2023 13:22:45 +0100 Subject: Make sure that time labels label an entire day This still isn't ideal, as it only covers the cases where 8h is the smallest division. --- src/graphs/TimeLabels.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/graphs/TimeLabels.qml b/src/graphs/TimeLabels.qml index eebec9e..b793040 100644 --- a/src/graphs/TimeLabels.qml +++ b/src/graphs/TimeLabels.qml @@ -84,9 +84,11 @@ Item { i++ } - } else if (delta < 7200 * maxLabels) { // check every 2 hours - if (delta > 3600 * maxLabels) { - interval = 7200 //label every 2h if 1h doesn't work - this is an ugly workaround so that a full day still gets some sort of divisions + } else if (delta < 14400 * maxLabels) { // check every 4 hours - this is an ugly workaround so that a full day still gets some sort of divisions + if (delta > 7200 * maxLabels) { + interval = 14400 //label every 4h if 1h doesn't work + } else if (delta > 3600 * maxLabels) { + interval = 7200 //label every 2h if 1h doesn't work } else if (delta < 3600 * minLabels) { interval = 1800 //label every 30m otherwise } else { -- cgit v1.2.3-70-g09d2