From b5c8d0dbb484153d9f8235b3c607e9e33e1b4603 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 9 Jan 2021 00:25:17 +0100 Subject: [PATCH] statistics: fix range in categorical axes The range for a one-bin chart is [-0.5,0.5], thus the range in an n-bin chart is [-0.5,n-0.5], not [-0.5,n+0.5]. Signed-off-by: Berthold Stoeger --- stats/statsaxis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stats/statsaxis.cpp b/stats/statsaxis.cpp index 734de6a63..019a16256 100644 --- a/stats/statsaxis.cpp +++ b/stats/statsaxis.cpp @@ -340,7 +340,7 @@ CategoryAxis::CategoryAxis(QtCharts::QChart *chart, const QString &title, const addTick(pos + 0.5); pos += 1.0; } - setRange(-0.5, static_cast(labelsIn.size()) + 0.5); + setRange(-0.5, static_cast(labelsIn.size()) - 0.5); } void CategoryAxis::updateLabels()