summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/charts/axis/chartaxiselement.cpp4
-rw-r--r--src/charts/barchart/abstractbarchartitem.cpp9
2 files changed, 11 insertions, 2 deletions
diff --git a/src/charts/axis/chartaxiselement.cpp b/src/charts/axis/chartaxiselement.cpp
index c5a1ab91..5282ee36 100644
--- a/src/charts/axis/chartaxiselement.cpp
+++ b/src/charts/axis/chartaxiselement.cpp
@@ -343,7 +343,7 @@ QStringList ChartAxisElement::createValueLabels(qreal min, qreal max, int ticks,
if (max <= min || ticks < 1)
return labels;
- if (format.isNull()) {
+ if (format.isEmpty()) {
int n = qMax(int(-qFloor(std::log10((max - min) / (ticks - 1)))), 0) + 1;
for (int i = 0; i < ticks; i++) {
qreal value = min + (i * (max - min) / (ticks - 1));
@@ -395,7 +395,7 @@ QStringList ChartAxisElement::createLogValueLabels(qreal min, qreal max, qreal b
else
firstTick = qCeil(std::log10(max) / std::log10(base));
- if (format.isNull()) {
+ if (format.isEmpty()) {
int n = 0;
if (ticks > 1)
n = qMax(int(-qFloor(std::log10((max - min) / (ticks - 1)))), 0);
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();
}