From 50f7b77dbd81bd6ecf86b2e1040138c81f8b56dd Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Thu, 19 Feb 2026 15:23:16 +0100 Subject: [PATCH] Optimizer UI: fix mobile x labels (#27513) --- assets/js/components/Optimize/ChargeChart.vue | 3 ++- assets/js/components/Optimize/PriceChart.vue | 3 ++- assets/js/components/Optimize/SocChart.vue | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/js/components/Optimize/ChargeChart.vue b/assets/js/components/Optimize/ChargeChart.vue index da0861c36..ea77f47a0 100644 --- a/assets/js/components/Optimize/ChargeChart.vue +++ b/assets/js/components/Optimize/ChargeChart.vue @@ -211,7 +211,8 @@ export default defineComponent({ // Show ticks at exact hour boundaries if (minute === 0) { // Show labels only at hours divisible by 4 - if (hour % 4 === 0) { + const step = window.innerWidth < 576 ? 6 : 4; + if (hour % step === 0) { return hour.toString(); } // Show tick but no label for other hours diff --git a/assets/js/components/Optimize/PriceChart.vue b/assets/js/components/Optimize/PriceChart.vue index af16def90..a6cff7528 100644 --- a/assets/js/components/Optimize/PriceChart.vue +++ b/assets/js/components/Optimize/PriceChart.vue @@ -177,7 +177,8 @@ export default defineComponent({ // Show ticks at exact hour boundaries if (minute === 0) { // Show labels only at hours divisible by 4 - if (hour % 4 === 0) { + const step = window.innerWidth < 576 ? 6 : 4; + if (hour % step === 0) { return hour.toString(); } // Show tick but no label for other hours diff --git a/assets/js/components/Optimize/SocChart.vue b/assets/js/components/Optimize/SocChart.vue index 9251be73f..3329b4ce8 100644 --- a/assets/js/components/Optimize/SocChart.vue +++ b/assets/js/components/Optimize/SocChart.vue @@ -189,7 +189,8 @@ export default defineComponent({ // Show ticks at exact hour boundaries if (minute === 0) { // Show labels only at hours divisible by 4 - if (hour % 4 === 0) { + const step = window.innerWidth < 576 ? 6 : 4; + if (hour % step === 0) { return hour.toString(); } // Show tick but no label for other hours