##// END OF EJS Templates
Removes xygird class
Removes xygird class

File last commit:

r62:d89198258a93
r68:d0520e3fb13d
Show More
barchartseries.cpp
55 lines | 1020 B | text/x-c | CppLexer
/ src / barchart / barchartseries.cpp
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 #include "barchartseries.h"
QTCOMMERCIALCHART_BEGIN_NAMESPACE
sauimone
Refactored series creation.
r62 BarChartSeries::BarChartSeries(QObject *parent)
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 : QChartSeries(parent)
{
}
sauimone
Refactored series creation.
r62 bool BarChartSeries::setData(QList<int> data)
{
mData = data;
return true;
}
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 int BarChartSeries::min()
{
sauimone
Refactored series creation.
r62 Q_ASSERT(mData.count() > 0);
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 // TODO: make min and max members and update them when data changes.
// This is slower since they are checked every time, even if data is same since previous call.
int min = mData.at(0);
for (int i=0; i <mData.count(); i++) {
if (mData.at(i) < min) {
min = mData.at(i);
}
}
return min;
}
int BarChartSeries::max()
{
sauimone
Refactored series creation.
r62 Q_ASSERT(mData.count() > 0);
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 int max = mData.at(0);
for (int i=0; i <mData.count(); i++) {
if (mData.at(i) > max) {
max = mData.at(i);
}
}
return max;
}
int BarChartSeries::count()
{
return mData.count();
}
int BarChartSeries::valueAt(int i)
{
return mData.at(i);
}
QTCOMMERCIALCHART_END_NAMESPACE