mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: fix range in categorical axes
Fix a bug that was fixed inb5c8d0dbb4
and reintroduced ine7907c494f
. Here is the original commit message: 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:
parent
db69c38245
commit
9e61a6372a
1 changed files with 4 additions and 1 deletions
|
@ -379,7 +379,10 @@ CategoryAxis::CategoryAxis(StatsView &view, const QString &title, const std::vec
|
|||
StatsAxis(view, title, horizontal, true),
|
||||
labelsText(labels)
|
||||
{
|
||||
setRange(-0.5, static_cast<double>(labels.size()) + 0.5);
|
||||
if (!labels.empty())
|
||||
setRange(-0.5, static_cast<double>(labels.size()) - 0.5);
|
||||
else
|
||||
setRange(-1.0, 1.0);
|
||||
}
|
||||
|
||||
// No implementation because the labels are inside ticks and this
|
||||
|
|
Loading…
Add table
Reference in a new issue