@@ -247,6 +247,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||||
247 | } |
|
247 | } | |
248 |
|
248 | |||
249 | case QSeries::SeriesTypeScatter: { |
|
249 | case QSeries::SeriesTypeScatter: { | |
|
250 | ||||
250 | QScatterSeries *scatterSeries = static_cast<QScatterSeries *>(series); |
|
251 | QScatterSeries *scatterSeries = static_cast<QScatterSeries *>(series); | |
251 | ScatterChartItem *scatter = new ScatterChartItem(scatterSeries,this); |
|
252 | ScatterChartItem *scatter = new ScatterChartItem(scatterSeries,this); | |
252 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
253 | if(m_options.testFlag(QChart::SeriesAnimations)) { | |
@@ -343,7 +344,6 void ChartPresenter::setAnimationOptions(QChart::AnimationOptions options) | |||||
343 |
|
344 | |||
344 | if(m_options!=QChart::NoAnimation && !m_animator) { |
|
345 | if(m_options!=QChart::NoAnimation && !m_animator) { | |
345 | m_animator= new ChartAnimator(this); |
|
346 | m_animator= new ChartAnimator(this); | |
346 |
|
||||
347 | } |
|
347 | } | |
348 | resetAllElements(); |
|
348 | resetAllElements(); | |
349 | } |
|
349 | } | |
@@ -504,9 +504,13 void ChartPresenter::updateLayout() | |||||
504 | m_backgroundItem->setRect(m_rect.adjusted(m_marginTiny,m_marginTiny, -m_marginTiny, -m_marginTiny)); |
|
504 | m_backgroundItem->setRect(m_rect.adjusted(m_marginTiny,m_marginTiny, -m_marginTiny, -m_marginTiny)); | |
505 | } |
|
505 | } | |
506 |
|
506 | |||
507 |
|
|
507 | QRectF chartRect = m_rect.adjusted(m_chartMargins.left(),m_chartMargins.top(),-m_chartMargins.right(),-m_chartMargins.bottom()); | |
|
508 | ||||
|
509 | if(m_chartRect!=chartRect){ | |||
|
510 | m_chartRect=chartRect; | |||
|
511 | emit geometryChanged(m_chartRect); | |||
|
512 | } | |||
508 |
|
513 | |||
509 | emit geometryChanged(m_chartRect); |
|
|||
510 | legend->setGeometry(m_rect.adjusted(m_legendMargins.left(),m_legendMargins.top(),-m_legendMargins.right(),-m_legendMargins.bottom())); |
|
514 | legend->setGeometry(m_rect.adjusted(m_legendMargins.left(),m_legendMargins.top(),-m_legendMargins.right(),-m_legendMargins.bottom())); | |
511 | } |
|
515 | } | |
512 |
|
516 |
@@ -107,7 +107,7 void ScatterChartItem::setLayout(QVector<QPointF>& points) | |||||
107 | return; |
|
107 | return; | |
108 | } |
|
108 | } | |
109 |
|
109 | |||
110 |
int diff = |
|
110 | int diff = m_items.childItems().size() - points.size(); | |
111 |
|
111 | |||
112 | if(diff>0) { |
|
112 | if(diff>0) { | |
113 | deletePoints(diff); |
|
113 | deletePoints(diff); |
General Comments 0
You need to be logged in to leave comments.
Login now