summaryrefslogtreecommitdiffstats
path: root/src/barchart/vertical/stacked/stackedbarchartitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/barchart/vertical/stacked/stackedbarchartitem.cpp')
-rw-r--r--src/barchart/vertical/stacked/stackedbarchartitem.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/barchart/vertical/stacked/stackedbarchartitem.cpp b/src/barchart/vertical/stacked/stackedbarchartitem.cpp
index 82329194..72bc650a 100644
--- a/src/barchart/vertical/stacked/stackedbarchartitem.cpp
+++ b/src/barchart/vertical/stacked/stackedbarchartitem.cpp
@@ -117,14 +117,15 @@ void StackedBarChartItem::positionLabels()
qreal xPos = m_layout.at(i).center().x() - label->boundingRect().center().x();
qreal yPos = 0;
+ int offset = m_bars.at(i)->pen().width() / 2 + 2;
if (m_series->labelsPosition() == QAbstractBarSeries::LabelsCenter)
yPos = m_layout.at(i).center().y() - label->boundingRect().center().y();
else if (m_series->labelsPosition() == QAbstractBarSeries::LabelsInsideEnd)
- yPos = m_layout.at(i).top();
+ yPos = m_layout.at(i).top() - offset;
else if (m_series->labelsPosition() == QAbstractBarSeries::LabelsInsideBase)
- yPos = m_layout.at(i).bottom() - label->boundingRect().height();
+ yPos = m_layout.at(i).bottom() - label->boundingRect().height() + offset;
else if (m_series->labelsPosition() == QAbstractBarSeries::LabelsOutsideEnd)
- yPos = m_layout.at(i).top() - label->boundingRect().height();
+ yPos = m_layout.at(i).top() - label->boundingRect().height() + offset;
label->setPos(xPos, yPos);
label->setZValue(zValue() + 1);