diff options
author | Robert C. Helling <helling@atdotde.de> | 2021-01-17 13:34:18 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-02-13 13:02:54 -0800 |
commit | 5c098eea29fdb1cd663b78db4e430a1c76c2209a (patch) | |
tree | d084244a3dfc20739e78bc4284e0b1075bb82a8e /stats/barseries.cpp | |
parent | 1797b59c102eaa5b2091504d96616433aaf0a239 (diff) | |
download | subsurface-5c098eea29fdb1cd663b78db4e430a1c76c2209a.tar.gz |
statistics: select dives from Scatter Plot
When clicking on items in a plot, select the corresponding
dives. This can be useful for data validation.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/barseries.cpp')
-rw-r--r-- | stats/barseries.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/stats/barseries.cpp b/stats/barseries.cpp index 8767a04db..a501ddea9 100644 --- a/stats/barseries.cpp +++ b/stats/barseries.cpp @@ -6,6 +6,7 @@ #include "statstranslations.h" #include "statsview.h" #include "zvalues.h" +#include "core/selection.h" #include <math.h> // for lrint() #include <QLocale> @@ -404,3 +405,13 @@ void BarSeries::unhighlight() items[highlighted.bar].highlight(highlighted.subitem, false, binCount()); highlighted = Index(); } + +void BarSeries::selectItemsUnderMouse(const QPointF &pos) +{ + Index index = getItemUnderMouse(pos); + if (index.bar < 0) + return setSelection({}, nullptr); + + const std::vector<dive *> &dives = items[index.bar].subitems[index.subitem].dives; + setSelection(dives, dives.empty() ? nullptr : dives.front()); +} |