From 3f1d2d4ee239e8b72ba03ad11604d5b3a8ad03f6 Mon Sep 17 00:00:00 2001 From: Ulrich Meine Date: Mon, 6 Apr 2026 00:58:38 +0200 Subject: [PATCH] Fix vertikal time axis label --- lib/obp60task/OBPcharts.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/obp60task/OBPcharts.cpp b/lib/obp60task/OBPcharts.cpp index eda15e9..b29e52f 100644 --- a/lib/obp60task/OBPcharts.cpp +++ b/lib/obp60task/OBPcharts.cpp @@ -476,11 +476,12 @@ void Chart::drawChrtTimeAxis(const char chrtDir, const int8_t chrtSz, const int8 intv = 60; // print axis label each 60 pixels = seconds axSlots = timAxis / intv; // number of axis labels; value will be truncated to full number - i = axSlots * chrtIntv * -1; // current minute label +// i = axSlots * chrtIntv * -1; // current minute label if (chrtDir == HORIZONTAL) { getdisplay().fillRect(0, cRoot.y, dWidth, 2, fgColor); + i = axSlots * chrtIntv * -1; // current minute label // LOG_DEBUG(GwLog::DEBUG, "Chart::drawChrtTimeAxis: intv: %d, axSlots: %d, timAxis: %d, chrtIntv: %d", intv, axSlots, timAxis, chrtIntv); for (int j = intv; j < timAxis - 1; j += intv) { // fill time axis with values but keep area free on right hand side for value label @@ -495,6 +496,7 @@ void Chart::drawChrtTimeAxis(const char chrtDir, const int8_t chrtSz, const int8 } else { // vertical chart + i = chrtIntv * -1; // current minute label for (float j = intv; j < timAxis - 1; j += intv) { // don't print time label at upper and lower end of time axis snprintf(sTime, sizeof(sTime), "%d", i); @@ -507,7 +509,8 @@ void Chart::drawChrtTimeAxis(const char chrtDir, const int8_t chrtSz, const int8 } else if (chrtSz == HALF_SIZE_RIGHT) { // half size chart; right side drawTextCenter(dWidth / 2, cRoot.y + j, sTime); // time value; print mid screen } - i += chrtIntv; +// i += chrtIntv; + i -= chrtIntv; } } }