summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-18 18:00:39 +0100
committerLiang Qi <liang.qi@qt.io>2018-01-18 21:24:19 +0100
commit175d864fbb96ed64cc609fe08df4b28668368040 (patch)
treeda48270824b39ad76d912187a8f8790962e56efd /src
parentd8ee9960736172e94def03d01a90c95e8c8c234f (diff)
parenta2eb6b3b15e19d5c8215c41694ce8c74918cb58a (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: .qmake.conf Change-Id: I02fb1d17385bfb520e7f6dd2d7c69d79a2890bcd
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();
}