barchartseries.h
48 lines
| 1.1 KiB
| text/x-c
|
CLexer
sauimone
|
r56 | #ifndef BARCHARTSERIES_H | ||
#define BARCHARTSERIES_H | ||||
#include <QList> | ||||
sauimone
|
r71 | #include <QRectF> | ||
#include <QAbstractItemModel> | ||||
sauimone
|
r56 | #include "qchartseries.h" | ||
#include "qchartglobal.h" | ||||
sauimone
|
r74 | // TODO: Can this class be combined with series? | ||
class BarGroup; | ||||
sauimone
|
r56 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
// Container for series | ||||
class QTCOMMERCIALCHART_EXPORT BarChartSeries : public QChartSeries | ||||
{ | ||||
sauimone
|
r71 | Q_OBJECT | ||
sauimone
|
r56 | public: | ||
sauimone
|
r62 | BarChartSeries(QObject* parent=0); | ||
sauimone
|
r56 | |||
// from QChartSeries | ||||
virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; } | ||||
sauimone
|
r71 | // TODO: This as dataModel instead of n different setters. (data model itself can accept lists and whatnot) | ||
virtual bool setData(QAbstractItemModel* model); | ||||
sauimone
|
r62 | |||
sauimone
|
r56 | // Methods to find out minimum and maximum values of data | ||
int min(); | ||||
int max(); | ||||
sauimone
|
r71 | int countSeries(); | ||
int countItemsInSeries(); // Count items in one series. | ||||
int countTotalItems(); | ||||
int valueAt(int series, int item); | ||||
public Q_SLOTS: | ||||
void chartSizeChanged(QRectF rect); | ||||
sauimone
|
r56 | |||
private: | ||||
sauimone
|
r71 | QAbstractItemModel* mModel; | ||
sauimone
|
r74 | BarGroup* mBarGroup; | ||
sauimone
|
r56 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // BARCHARTSERIES_H | ||||