##// END OF EJS Templates
updated barchart examples
updated barchart examples

File last commit:

r169:1723c50daa1e
r170:ff886517a70e
Show More
barchartseriesbase.cpp
84 lines | 1.6 KiB | text/x-c | CppLexer
/ src / barchart / barchartseriesbase.cpp
sauimone
refactored barcharts. layout to derived classess other funtionality to base class
r126 #include <limits.h>
#include <QDebug>
#include "barchartseriesbase.h"
#include "bargroup.h"
sauimone
model delegate for bar series. updated examples
r161 #include "barchartmodel_p.h"
sauimone
proof of concept implementation for barset and barcategory
r169 #include "qbarset.h"
sauimone
refactored barcharts. layout to derived classess other funtionality to base class
r126
QTCOMMERCIALCHART_BEGIN_NAMESPACE
sauimone
proof of concept implementation for barset and barcategory
r169 BarChartSeriesBase::BarChartSeriesBase(QBarCategory &category, QObject *parent)
sauimone
refactored barcharts. layout to derived classess other funtionality to base class
r126 : QChartSeries(parent)
sauimone
proof of concept implementation for barset and barcategory
r169 ,mModel(new BarChartModel(category, this))
sauimone
refactored barcharts. layout to derived classess other funtionality to base class
r126 {
}
sauimone
model delegate for bar series. updated examples
r161
int BarChartSeriesBase::addData(QList<qreal> data)
sauimone
model prototyping for bar chart
r159 {
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 return mModel->addData(data);
sauimone
model delegate for bar series. updated examples
r161 }
sauimone
model prototyping for bar chart
r159
sauimone
model delegate for bar series. updated examples
r161 void BarChartSeriesBase::removeData(int id)
{
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 mModel->removeData(id);
}
void BarChartSeriesBase::setLabels(QList<QString> labels)
{
mLabels = labels;
sauimone
model delegate for bar series. updated examples
r161 }
sauimone
proof of concept implementation for barset and barcategory
r169 void BarChartSeriesBase::addBarSet(QBarSet &set)
{
mModel->addBarSet(set);
}
void BarChartSeriesBase::removeBarSet(QBarSet &set)
{
mModel->removeBarSet(set);
}
sauimone
model delegate for bar series. updated examples
r161 qreal BarChartSeriesBase::min()
{
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 return mModel->min();
sauimone
model prototyping for bar chart
r159 }
qreal BarChartSeriesBase::max()
{
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 return mModel->max();
sauimone
model delegate for bar series. updated examples
r161 }
int BarChartSeriesBase::countColumns()
{
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 return mModel->countColumns();
sauimone
model delegate for bar series. updated examples
r161 }
qreal BarChartSeriesBase::valueAt(int series, int item)
{
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 // qDebug() << "BarChartSeriesBase::valueAt" << series << item;
return mModel->valueAt(series,item);
sauimone
model prototyping for bar chart
r159 }
sauimone
model delegate for bar series. updated examples
r161 qreal BarChartSeriesBase::maxColumnSum()
sauimone
model prototyping for bar chart
r159 {
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 // qDebug() << "BarChartSeriesBase::maxColumnSum" << mModel->maxColumnSum();
return mModel->maxColumnSum();
sauimone
model prototyping for bar chart
r159 }
sauimone
model delegate for bar series. updated examples
r161 BarChartModel& BarChartSeriesBase::model()
sauimone
model prototyping for bar chart
r159 {
sauimone
added labels to series, intergrated with test app. minor hack to test app
r167 return *mModel;
}
QString BarChartSeriesBase::label(int item)
{
if ((item>=0) && (item < mLabels.count())) {
return mLabels.at(item);
}
return QString("");
sauimone
model prototyping for bar chart
r159 }
sauimone
refactored barcharts. layout to derived classess other funtionality to base class
r126
#include "moc_barchartseriesbase.cpp"
QTCOMMERCIALCHART_END_NAMESPACE