summaryrefslogtreecommitdiffstats
path: root/stats
diff options
context:
space:
mode:
Diffstat (limited to 'stats')
-rw-r--r--stats/statsaxis.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/stats/statsaxis.cpp b/stats/statsaxis.cpp
index ebd41fb94..734de6a63 100644
--- a/stats/statsaxis.cpp
+++ b/stats/statsaxis.cpp
@@ -411,11 +411,20 @@ void HistogramAxis::updateLabels()
}
}
labels.reserve((bin_values.size() - first) / step + 1);
+ // Always add a tick at the beginning of the axis - this is
+ // important for the grid, which uses the ticks.
+ if (first != 0)
+ addTick(bin_values.front().value);
+ int last = first;
for (int i = first; i < (int)bin_values.size(); i += step) {
const auto &[name, value, recommended] = bin_values[i];
addLabel(name, value);
addTick(value);
+ last = i;
}
+ // Always add a tick at the end of the axis (see above).
+ if (last != (int)bin_values.size() - 1)
+ addTick(bin_values.back().value);
}
// Helper function to turn days since "Unix epoch" into a timestamp_t