statistics: highlight selected boxes in box plot

In analogy to bar plots, highlight selected boxes in box plots.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-07 18:10:08 +01:00 committed by Dirk Hohndel
parent 91d371374b
commit bd252fc820
5 changed files with 37 additions and 5 deletions

View file

@ -247,7 +247,7 @@ std::vector<BarSeries::SubItem> BarSeries::makeSubItems(std::vector<SubItemDesc>
int bin_nr = 0;
for (auto &[v, dives, label]: items) {
if (v > 0.0) {
bool selected = std::all_of(dives.begin(), dives.end(), [] (const dive *d) { return d->selected; });
bool selected = allDivesSelected(dives);
res.push_back({ view.createChartItem<ChartBarItem>(ChartZValue::Series, barBorderWidth),
std::move(dives),
{}, from, from + v, bin_nr, selected });
@ -428,7 +428,7 @@ void BarSeries::divesSelected(const QVector<dive *> &)
{
for (Item &item: items) {
for (SubItem &subitem: item.subitems) {
bool selected = std::all_of(subitem.dives.begin(), subitem.dives.end(), [] (const dive *d) { return d->selected; });
bool selected = allDivesSelected(subitem.dives);
if (subitem.selected != selected) {
subitem.selected = selected;