summaryrefslogtreecommitdiffstats
path: root/src/charts/barchart/abstractbarchartitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/charts/barchart/abstractbarchartitem.cpp')
-rw-r--r--src/charts/barchart/abstractbarchartitem.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/charts/barchart/abstractbarchartitem.cpp b/src/charts/barchart/abstractbarchartitem.cpp
index 910066b5..f435044e 100644
--- a/src/charts/barchart/abstractbarchartitem.cpp
+++ b/src/charts/barchart/abstractbarchartitem.cpp
@@ -394,6 +394,15 @@ void AbstractBarChartItem::handleBarValueRemove(int index, int count, QBarSet *b
// Value removals from the middle of barset need to dirty the rest of the labels of the set.
markLabelsDirty(barset, index, -1);
+
+ // make sure labels are not visible for removed bars
+ const auto bars = m_barMap.value(barset);
+ for (int c = barset->count(); c < bars.count(); ++c) {
+ auto label = bars.at(c)->labelItem();
+ if (label)
+ label->setVisible(false);
+ }
+
handleLayoutChanged();
}