aboutsummaryrefslogtreecommitdiffstats
path: root/stats/statsgrid.h
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/statsgrid.h
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/statsgrid.h')
-rw-r--r--stats/statsgrid.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/stats/statsgrid.h b/stats/statsgrid.h
new file mode 100644
index 000000000..0fdb2a188
--- /dev/null
+++ b/stats/statsgrid.h
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0
+// The background grid of a chart
+
+#include <memory>
+#include <vector>
+#include <QVector>
+#include <QGraphicsLineItem>
+
+class StatsAxis;
+namespace QtCharts {
+ class QChart;
+};
+
+class StatsGrid {
+public:
+ StatsGrid(QtCharts::QChart *chart, const StatsAxis &xAxis, const StatsAxis &yAxis);
+ void updatePositions();
+private:
+ QtCharts::QChart *chart;
+ const StatsAxis &xAxis, &yAxis;
+ std::vector<std::unique_ptr<QGraphicsLineItem>> lines;
+};