summaryrefslogtreecommitdiffstats
path: root/stats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-09 00:25:17 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-09 14:25:02 -0800
commitb5c8d0dbb484153d9f8235b3c607e9e33e1b4603 (patch)
treeb0f14ff9ae2f3b4c8dc19b93702c25412346195c /stats
parent83848fb2a8a987aa2bbe75847f53bbbb5fe15b36 (diff)
downloadsubsurface-b5c8d0dbb484153d9f8235b3c607e9e33e1b4603.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats')
-rw-r--r--stats/statsaxis.cpp2
1 files changed, 1 insertions, 1 deletions
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<double>(labelsIn.size()) + 0.5);
+ setRange(-0.5, static_cast<double>(labelsIn.size()) - 0.5);
}
void CategoryAxis::updateLabels()