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