##// 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 255 Q_ASSERT(labels.size() == ticksList.size());
256 256 Q_ASSERT(layout.size() == ticksList.size());
257 Q_ASSERT(layout.size() == m_ticksCount);
258 257
259 258 switch (m_type)
260 259 {
@@ -271,9 +270,9 void AxisItem::setLayout(QVector<qreal>& layout)
271 270 QPointF center = labelItem->boundingRect().center();
272 271 labelItem->setTransformOriginPoint(center.x(), center.y());
273 272 labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding);
274 if(i%2 && i+1 < layout.size() && i>1) {
275 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2));
276 rectItem->setRect(layout[i],m_rect.top(),layout[i+1]-layout[i],m_rect.height());
273 if((i+1)%2 && i>1) {
274 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2-1));
275 rectItem->setRect(layout[i-1],m_rect.top(),layout[i]-layout[i-1],m_rect.height());
277 276 }
278 277 lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1));
279 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 293 QPointF center = labelItem->boundingRect().center();
295 294 labelItem->setTransformOriginPoint(center.x(), center.y());
296 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) {
298 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2));
299 rectItem->setRect(m_rect.left(),layout[i],m_rect.width(),layout[i]-layout[i+1]);
296 if((i+1)%2 && i>1) {
297 QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2-1));
298 rectItem->setRect(m_rect.left(),layout[i-1],m_rect.width(),layout[i-1]-layout[i]);
300 299 }
301 300 lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1));
302 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 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