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>
This commit is contained in:
Berthold Stoeger 2021-01-09 00:25:17 +01:00 committed by Dirk Hohndel
parent 83848fb2a8
commit b5c8d0dbb4

View file

@ -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()