diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-05 13:51:39 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-06 12:31:22 -0800 |
commit | ab324ed769b4d39816020bf649defb61cb4bff41 (patch) | |
tree | 066dfab03a5d3a370b7928d53eb0c18d96cda62e /stats/statsaxis.cpp | |
parent | 8dfa3f6db3eda8bce432afb7407efe2d8822ebbd (diff) | |
download | subsurface-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.cpp | 9 |
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 { |