@@ -70,7 +70,10 QPainterPath LineChartItem::shape() const | |||
|
70 | 70 | |
|
71 | 71 | void LineChartItem::updateGeometry() |
|
72 | 72 | { |
|
73 | const QVector<QPointF> &points = geometryPoints(); | |
|
73 | // Store the points to a local variable so that the old line gets properly cleared | |
|
74 | // when animation starts. | |
|
75 | m_linePoints = geometryPoints(); | |
|
76 | const QVector<QPointF> &points = m_linePoints; | |
|
74 | 77 | |
|
75 | 78 | if (points.size() == 0) { |
|
76 | 79 | prepareGeometryChange(); |
@@ -377,8 +380,8 void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt | |||
|
377 | 380 | // to ensure proper continuity of the pattern |
|
378 | 381 | painter->drawPath(m_linePath); |
|
379 | 382 | } else { |
|
380 |
for (int i(1); i < m_ |
|
|
381 |
painter->drawLine(m_ |
|
|
383 | for (int i(1); i < m_linePoints.size(); i++) | |
|
384 | painter->drawLine(m_linePoints.at(i - 1), m_linePoints.at(i)); | |
|
382 | 385 | } |
|
383 | 386 | } |
|
384 | 387 | |
@@ -389,7 +392,7 void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt | |||
|
389 | 392 | painter->setClipping(true); |
|
390 | 393 | else |
|
391 | 394 | painter->setClipping(false); |
|
392 |
m_series->d_func()->drawSeriesPointLabels(painter, m_ |
|
|
395 | m_series->d_func()->drawSeriesPointLabels(painter, m_linePoints, m_linePen.width() / 2); | |
|
393 | 396 | } |
|
394 | 397 | |
|
395 | 398 | painter->restore(); |
General Comments 0
You need to be logged in to leave comments.
Login now