summaryrefslogtreecommitdiffstats
path: root/stats/statsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stats/statsview.cpp')
-rw-r--r--stats/statsview.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/stats/statsview.cpp b/stats/statsview.cpp
index 1533583ba..5583643d7 100644
--- a/stats/statsview.cpp
+++ b/stats/statsview.cpp
@@ -97,15 +97,21 @@ void StatsView::plotAreaChanged(const QSizeF &s)
if (title)
top += title->boundingRect().height() + titleBorder;
// Currently, we only have either none, or an x- and a y-axis
- if (xAxis)
+ std::pair<double,double> horizontalSpace{ 0.0, 0.0 };
+ if (xAxis) {
bottom -= xAxis->height();
+ horizontalSpace = xAxis->horizontalOverhang();
+ }
if (bottom - top < minSize)
return;
if (yAxis) {
yAxis->setSize(bottom - top);
- left += yAxis->width();
- yAxis->setPos(QPointF(left, bottom));
+ horizontalSpace.first = std::max(horizontalSpace.first, yAxis->width());
}
+ left += horizontalSpace.first;
+ right -= horizontalSpace.second;
+ if (yAxis)
+ yAxis->setPos(QPointF(left, bottom));
if (right - left < minSize)
return;
if (xAxis) {