##// END OF EJS Templates
Fixes shades counter
Michal Klocek -
r551:bd55491f7b0f
parent child
Show More
@@ -254,7 +254,6 void AxisItem::setLayout(QVector<qreal>& layout)
254
254
255 Q_ASSERT(labels.size() == ticksList.size());
255 Q_ASSERT(labels.size() == ticksList.size());
256 Q_ASSERT(layout.size() == ticksList.size());
256 Q_ASSERT(layout.size() == ticksList.size());
257 Q_ASSERT(layout.size() == m_ticksCount);
258
257
259 switch (m_type)
258 switch (m_type)
260 {
259 {
@@ -271,9 +270,9 void AxisItem::setLayout(QVector<qreal>& layout)
271 QPointF center = labelItem->boundingRect().center();
270 QPointF center = labelItem->boundingRect().center();
272 labelItem->setTransformOriginPoint(center.x(), center.y());
271 labelItem->setTransformOriginPoint(center.x(), center.y());
273 labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding);
272 labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding);
274 if(i%2 && i+1 < layout.size() && i>1) {
273 if((i+1)%2 && i>1) {
275 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2));
274 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2-1));
276 rectItem->setRect(layout[i],m_rect.top(),layout[i+1]-layout[i],m_rect.height());
275 rectItem->setRect(layout[i-1],m_rect.top(),layout[i]-layout[i-1],m_rect.height());
277 }
276 }
278 lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1));
277 lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1));
279 lineItem->setLine(layout[i],m_rect.bottom(),layout[i],m_rect.bottom()+5);
278 lineItem->setLine(layout[i],m_rect.bottom(),layout[i],m_rect.bottom()+5);
@@ -294,9 +293,9 void AxisItem::setLayout(QVector<qreal>& layout)
294 QPointF center = labelItem->boundingRect().center();
293 QPointF center = labelItem->boundingRect().center();
295 labelItem->setTransformOriginPoint(center.x(), center.y());
294 labelItem->setTransformOriginPoint(center.x(), center.y());
296 labelItem->setPos(m_rect.left() - labelItem->boundingRect().width() - label_padding , layout[i]-center.y());
295 labelItem->setPos(m_rect.left() - labelItem->boundingRect().width() - label_padding , layout[i]-center.y());
297 if(i%2 && i+1 < layout.size() && i>1) {
296 if((i+1)%2 && i>1) {
298 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2));
297 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2-1));
299 rectItem->setRect(m_rect.left(),layout[i],m_rect.width(),layout[i]-layout[i+1]);
298 rectItem->setRect(m_rect.left(),layout[i-1],m_rect.width(),layout[i-1]-layout[i]);
300 }
299 }
301 lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1));
300 lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1));
302 lineItem->setLine(m_rect.left()-5,layout[i],m_rect.left(),layout[i]);
301 lineItem->setLine(m_rect.left()-5,layout[i],m_rect.left(),layout[i]);
@@ -34,9 +34,9 QTCOMMERCIALCHART_BEGIN_NAMESPACE
34 */
34 */
35
35
36 /*!
36 /*!
37 \fn QPen QChartAxis::gridPen() const
37 \fn QPen QChartAxis::gridLinePen() const
38 \brief Returns pen used to draw grid.
38 \brief Returns pen used to draw grid.
39 \sa setGridPen()
39 \sa setGridLinePen()
40 */
40 */
41
41
42 /*!
42 /*!
General Comments 0
You need to be logged in to leave comments. Login now