diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-09-10 11:28:38 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-09-10 09:59:43 +0000 |
commit | 458692a5a59458b22b68900e1bc2abc22b380ab6 (patch) | |
tree | 140c6840b7adf32344f5f22e406e22162b0c28af /src/charts/barchart/vertical/percent | |
parent | acb3f8c5f190ebda7032127ba0ed80fcb4483fcf (diff) |
Added support for bar series value label angle
Task-number: QTRD-3249
Change-Id: I98f670f631ec85d58122fab97283802834995b4d
Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>
Diffstat (limited to 'src/charts/barchart/vertical/percent')
-rw-r--r-- | src/charts/barchart/vertical/percent/percentbarchartitem.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/charts/barchart/vertical/percent/percentbarchartitem.cpp b/src/charts/barchart/vertical/percent/percentbarchartitem.cpp index 2620b0c6..fbde59ab 100644 --- a/src/charts/barchart/vertical/percent/percentbarchartitem.cpp +++ b/src/charts/barchart/vertical/percent/percentbarchartitem.cpp @@ -144,24 +144,7 @@ void PercentBarChartItem::handleLabelsPositionChanged() void PercentBarChartItem::positionLabels() { - for (int i = 0; i < m_layout.count(); i++) { - QGraphicsTextItem *label = m_labels.at(i); - 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() - offset; - else if (m_series->labelsPosition() == QAbstractBarSeries::LabelsInsideBase) - 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() + offset; - - label->setPos(xPos, yPos); - label->setZValue(zValue() + 1); - } + positionLabelsVertical(); } #include "moc_percentbarchartitem_p.cpp" |