From ab324ed769b4d39816020bf649defb61cb4bff41 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 5 Jan 2021 13:51:39 +0100 Subject: statistics: paint custom grid With removal of QtCharts' axes, the grid was lost. Readd it. Signed-off-by: Berthold Stoeger --- stats/statsview.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'stats/statsview.cpp') 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(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(); } -- cgit v1.2.3-70-g09d2