##// END OF EJS Templates
Rename pie series total() -> sum() to be consistent with bar series.
Jani Honkonen -
r939:8c748f062756
parent child
Show More
@@ -60,7 +60,7 int main(int argc, char *argv[])
60 60
61 61 QObject::connect(series, SIGNAL(clicked(QPieSlice*, Qt::MouseButtons)), chart, SLOT(handleSliceClicked(QPieSlice*)));
62 62
63 *yearSeries << new DrilldownSlice(series->total(), name, series);
63 *yearSeries << new DrilldownSlice(series->sum(), name, series);
64 64 }
65 65
66 66 QObject::connect(yearSeries, SIGNAL(clicked(QPieSlice*, Qt::MouseButtons)), chart, SLOT(handleSliceClicked(QPieSlice*)));
@@ -380,10 +380,10 void QPieSeries::setLabelsVisible(bool visible)
380 380
381 381 \sa QPieSlice::value(), QPieSlice::setValue()
382 382 */
383 qreal QPieSeries::total() const
383 qreal QPieSeries::sum() const
384 384 {
385 385 Q_D(const QPieSeries);
386 return d->m_total;
386 return d->m_sum;
387 387 }
388 388
389 389 /*!
@@ -520,7 +520,7 QPieSeriesPrivate::QPieSeriesPrivate(QPieSeries *parent)
520 520 m_pieRelativeSize(0.7),
521 521 m_pieStartAngle(0),
522 522 m_pieEndAngle(360),
523 m_total(0),
523 m_sum(0),
524 524 m_mapValues(0),
525 525 m_mapLabels(0),
526 526 m_mapOrientation(Qt::Horizontal)
@@ -535,18 +535,18 QPieSeriesPrivate::~QPieSeriesPrivate()
535 535
536 536 void QPieSeriesPrivate::updateDerivativeData()
537 537 {
538 m_total = 0;
538 m_sum = 0;
539 539
540 540 // nothing to do?
541 541 if (m_slices.count() == 0)
542 542 return;
543 543
544 // calculate total
544 // calculate sum of all slices
545 545 foreach (QPieSlice* s, m_slices)
546 m_total += s->value();
546 m_sum += s->value();
547 547
548 548 // nothing to show..
549 if (qFuzzyIsNull(m_total))
549 if (qFuzzyIsNull(m_sum))
550 550 return;
551 551
552 552 // update slice attributes
@@ -556,7 +556,7 void QPieSeriesPrivate::updateDerivativeData()
556 556 foreach (QPieSlice* s, m_slices) {
557 557
558 558 PieSliceData data = PieSliceData::data(s);
559 data.m_percentage = s->value() / m_total;
559 data.m_percentage = s->value() / m_sum;
560 560 data.m_angleSpan = pieSpan * data.m_percentage;
561 561 data.m_startAngle = sliceAngle;
562 562 sliceAngle += data.m_angleSpan;
@@ -59,7 +59,7 public:
59 59 // calculated data
60 60 int count() const;
61 61 bool isEmpty() const;
62 qreal total() const;
62 qreal sum() const;
63 63
64 64 // pie customization
65 65 void setHorizontalPosition(qreal relativePosition);
@@ -55,7 +55,7 public:
55 55 qreal m_pieRelativeSize;
56 56 qreal m_pieStartAngle;
57 57 qreal m_pieEndAngle;
58 qreal m_total;
58 qreal m_sum;
59 59
60 60 // model map
61 61 int m_mapValues;
General Comments 0
You need to be logged in to leave comments. Login now