aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordodoradio <dodoradio@outlook.com>2023-07-23 13:22:45 +0100
committerdodoradio <dodoradio@outlook.com>2023-08-02 22:54:43 +0100
commitc6d8f3f3f5b27ad8e23e5fd73184c2769fc7b4e4 (patch)
treeb037a74e64e6efc334c439d7455fada43c18fa4c /src
parentdd8480cb8985d91d2cd99ca4741a4d8789eec700 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/graphs/TimeLabels.qml8
1 files changed, 5 insertions, 3 deletions
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 {