From 48659c3f7dfe4b02d5f1356ca2b0cf7b75685ed2 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 19 Oct 2022 21:46:08 +0200 Subject: [PATCH] statistics: fix display of month on continuous axis tm::tm_mon is 0..11, not 1..12, so we have to add one for display. Signed-off-by: Berthold Stoeger --- stats/statsaxis.cpp | 2 +- stats/statsvariables.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stats/statsaxis.cpp b/stats/statsaxis.cpp index 560fefbeb..2f7bbc9a1 100644 --- a/stats/statsaxis.cpp +++ b/stats/statsaxis.cpp @@ -630,7 +630,7 @@ static std::vector timeRangeToBins(double from, double to) } else if (act[2] == 0) { res.push_back({ monthname(act[1]), val, true }); } else { - QString s = format.arg(QString::number(act[2]), sep, QString::number(act[1])); + QString s = format.arg(QString::number(act[2]), sep, QString::number(act[1] + 1)); res.push_back({s, val, true }); } } diff --git a/stats/statsvariables.cpp b/stats/statsvariables.cpp index 2d32345e8..a68fc398a 100644 --- a/stats/statsvariables.cpp +++ b/stats/statsvariables.cpp @@ -924,7 +924,7 @@ struct DateMonthBinner : public SimpleContinuousBinner