diff options
Diffstat (limited to 'stats')
-rw-r--r-- | stats/statsaxis.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/stats/statsaxis.cpp b/stats/statsaxis.cpp index 7af41c14b..92c972e0e 100644 --- a/stats/statsaxis.cpp +++ b/stats/statsaxis.cpp @@ -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 |