Diffstat (limited to 'noncore/apps/checkbook/graphinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/graphinfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/noncore/apps/checkbook/graphinfo.cpp b/noncore/apps/checkbook/graphinfo.cpp index fec6896..5b72c80 100644 --- a/noncore/apps/checkbook/graphinfo.cpp +++ b/noncore/apps/checkbook/graphinfo.cpp @@ -52,72 +52,85 @@ GraphInfo::~GraphInfo() GraphInfo::GraphType GraphInfo::graphType() { return t; } void GraphInfo::setGraphType( GraphType type ) { t = type; } DataPointList *GraphInfo::dataPoints() { return d; } void GraphInfo::setDataPoints( DataPointList *data ) { d = data; } DataPointInfo *GraphInfo::firstDataPoint() { return( d->first() ); } DataPointInfo *GraphInfo::nextDataPoint() { return( d->next() ); } int GraphInfo::numberDataPoints() { return( d->count() ); } float GraphInfo::maxValue() { float max = 0.0; for ( DataPointInfo *data = d->first(); data; data = d->next() ) { if ( data->value() > max ) { max = data->value(); } } return max; } +float GraphInfo::minValue() +{ + float min = 0.0; + for ( DataPointInfo *data = d->first(); data; data = d->next() ) + { + if ( data->value() < min ) + { + min = data->value(); + } + } + return min; +} + float GraphInfo::totalValue() { float sum = 0.0; for ( DataPointInfo *data = d->first(); data; data = d->next() ) { sum += data->value(); } return sum; } void GraphInfo::setGraphTitle( const QString &title ) { gt = title; } void GraphInfo::setXAxisTitle( const QString &xtitle ) { xt = xtitle; } void GraphInfo::setYAxisTitle( const QString &ytitle ) { yt = ytitle; } |