summaryrefslogtreecommitdiffstats
path: root/stats/statsview.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-05 13:51:39 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-06 12:31:22 -0800
commitab324ed769b4d39816020bf649defb61cb4bff41 (patch)
tree066dfab03a5d3a370b7928d53eb0c18d96cda62e /stats/statsview.cpp
parent8dfa3f6db3eda8bce432afb7407efe2d8822ebbd (diff)
downloadsubsurface-ab324ed769b4d39816020bf649defb61cb4bff41.tar.gz
statistics: paint custom grid
With removal of QtCharts' axes, the grid was lost. Readd it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statsview.cpp')
-rw-r--r--stats/statsview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/stats/statsview.cpp b/stats/statsview.cpp
index 394620d13..d6da093b3 100644
--- a/stats/statsview.cpp
+++ b/stats/statsview.cpp
@@ -6,6 +6,7 @@
#include "pieseries.h"
#include "scatterseries.h"
#include "statsaxis.h"
+#include "statsgrid.h"
#include "statsstate.h"
#include "statstranslations.h"
#include "statsvariables.h"
@@ -118,6 +119,8 @@ void StatsView::plotAreaChanged(const QRectF &r)
xAxis->setPos(QPointF(left, bottom));
}
+ if (grid)
+ grid->updatePositions();
for (auto &series: series)
series->updatePositions();
for (QuartileMarker &marker: quartileMarkers)
@@ -195,6 +198,8 @@ void StatsView::setAxes(StatsAxis *x, StatsAxis *y)
{
xAxis = x;
yAxis = y;
+ if (x && y)
+ grid = std::make_unique<StatsGrid>(chart, *x, *y);
}
void StatsView::reset()
@@ -208,6 +213,7 @@ void StatsView::reset()
quartileMarkers.clear();
lineMarkers.clear();
chart->removeAllSeries();
+ grid.reset();
axes.clear();
title.reset();
}