barchartseriesbase.h
60 lines
| 1.5 KiB
| text/x-c
|
CLexer
sauimone
|
r126 | #ifndef BARCHARTSERIESBASE_H | ||
#define BARCHARTSERIESBASE_H | ||||
#include <QList> | ||||
#include <QAbstractItemModel> | ||||
#include "qchartseries.h" | ||||
#include "qchartglobal.h" | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
sauimone
|
r161 | class BarGroupBase; | ||
class BarChartModel; | ||||
sauimone
|
r169 | class QBarSet; | ||
class QBarCategory; | ||||
sauimone
|
r161 | |||
sauimone
|
r126 | // Container for series | ||
class QTCOMMERCIALCHART_EXPORT BarChartSeriesBase : public QChartSeries | ||||
{ | ||||
Q_OBJECT | ||||
protected: | ||||
sauimone
|
r169 | // BarChartSeriesBase(QObject* parent=0); | ||
BarChartSeriesBase(QBarCategory &category, QObject* parent=0); | ||||
sauimone
|
r126 | |||
public: | ||||
// from QChartSeries | ||||
virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeInvalid; } | ||||
sauimone
|
r169 | // TODO: These 3 will be removed. | ||
sauimone
|
r161 | int addData(QList<qreal> data); | ||
void removeData(int id); | ||||
sauimone
|
r167 | void setLabels(QList<QString> labels); | ||
sauimone
|
r159 | |||
sauimone
|
r169 | // TODO: Expose these to user in derived class instead of here? Common implementation for all bar charts, but not visible to user | ||
void addBarSet(QBarSet &set); // Bob[1,5,6,2,15,4] first value goes to category 1 etc.. | ||||
void removeBarSet(QBarSet &set); // | ||||
sauimone
|
r167 | // These shouldn't be visible to chart series user. However, ChartDataSet needs to access them, and friends are evil. | ||
sauimone
|
r159 | qreal min(); | ||
qreal max(); | ||||
sauimone
|
r161 | int countColumns(); // Count items in one series. | ||
qreal valueAt(int series, int item); | ||||
qreal maxColumnSum(); | ||||
BarChartModel& model(); | ||||
sauimone
|
r167 | QString label(int item); | ||
sauimone
|
r161 | |||
signals: | ||||
void changed(int index); | ||||
sauimone
|
r126 | |||
public Q_SLOTS: | ||||
private: | ||||
sauimone
|
r167 | BarChartModel* mModel; | ||
QList<QString> mLabels; | ||||
sauimone
|
r126 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // BARCHARTSERIESBASE_H | ||||