qbarchartseries.h
66 lines
| 2.0 KiB
| text/x-c
|
CLexer
sauimone
|
r56 | #ifndef BARCHARTSERIES_H | ||
#define BARCHARTSERIES_H | ||||
sauimone
|
r172 | #include "qchartseries.h" | ||
sauimone
|
r74 | |||
sauimone
|
r56 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
sauimone
|
r172 | class QBarCategory; | ||
class QBarSet; | ||||
class BarChartModel; | ||||
sauimone
|
r56 | // Container for series | ||
sauimone
|
r216 | class QTCOMMERCIALCHART_EXPORT QBarChartSeries : public QChartSeries | ||
sauimone
|
r56 | { | ||
sauimone
|
r71 | Q_OBJECT | ||
sauimone
|
r56 | public: | ||
sauimone
|
r216 | QBarChartSeries(QBarCategory *category, QObject* parent=0); | ||
sauimone
|
r56 | |||
virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; } | ||||
sauimone
|
r280 | void addBarSet(QBarSet *set); // Takes ownership of set | ||
void removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set | ||||
sauimone
|
r214 | int countSets(); | ||
sauimone
|
r323 | int countCategories(); | ||
sauimone
|
r296 | QBarSet* nextSet(bool getFirst=false); // Returns first set, if called with true | ||
sauimone
|
r288 | QBarSet *setAt(int index); | ||
sauimone
|
r171 | |||
sauimone
|
r288 | QList<QString> legend(); // Returns legend of series (ie. names of all sets in series) | ||
sauimone
|
r280 | |||
sauimone
|
r288 | public: | ||
sauimone
|
r173 | // TODO: Functions below this are not part of api and will be moved | ||
sauimone
|
r296 | // to private implementation, when we start using it | ||
// TODO: TO PIMPL ---> | ||||
sauimone
|
r313 | QString label(int category); | ||
sauimone
|
r172 | qreal min(); | ||
qreal max(); | ||||
qreal valueAt(int set, int category); | ||||
sauimone
|
r288 | qreal percentageAt(int set, int category); | ||
qreal categorySum(int category); | ||||
sauimone
|
r172 | qreal maxCategorySum(); | ||
BarChartModel& model(); | ||||
sauimone
|
r296 | // <--- TO PIMPL | ||
sauimone
|
r172 | |||
signals: | ||||
void changed(int index); | ||||
sauimone
|
r288 | // TODO: internal signals, these to private implementation. | ||
sauimone
|
r296 | // TODO: TO PIMPL ---> | ||
sauimone
|
r280 | void floatingValuesEnabled(bool enabled); | ||
sauimone
|
r288 | void toolTipEnabled(bool enabled); | ||
void separatorsEnabled(bool enabled); | ||||
void showToolTip(QPoint pos, QString tip); | ||||
sauimone
|
r296 | // <--- TO PIMPL | ||
public Q_SLOTS: | ||||
void enableFloatingValues(bool enabled=true); // enables floating values on top of bars | ||||
void enableToolTip(bool enabled=true); // enables tooltips | ||||
void enableSeparators(bool enabled=true); // enables separators between categories | ||||
sauimone
|
r171 | |||
sauimone
|
r281 | protected: | ||
sauimone
|
r172 | BarChartModel* mModel; | ||
sauimone
|
r56 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // BARCHARTSERIES_H | ||||