aboutsummaryrefslogtreecommitdiffstats
path: root/stats/statsaxis.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/statsaxis.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/statsaxis.cpp')
-rw-r--r--stats/statsaxis.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/stats/statsaxis.cpp b/stats/statsaxis.cpp
index 23923e7ea..3bdb8e427 100644
--- a/stats/statsaxis.cpp
+++ b/stats/statsaxis.cpp
@@ -135,6 +135,15 @@ void StatsAxis::addTick(double pos)
ticks.emplace_back(pos, chart);
}
+std::vector<double> StatsAxis::ticksPositions() const
+{
+ std::vector<double> res;
+ res.reserve(ticks.size());
+ for (const Tick &tick: ticks)
+ res.push_back(toScreen(tick.pos));
+ return res;
+}
+
// Map x (horizontal) or y (vertical) coordinate to or from screen coordinate
double StatsAxis::toScreen(double pos) const
{