##// END OF EJS Templates
Documentation for bar charts
sauimone -
r313:625c56c7d323
parent child
Show More
@@ -1,49 +1,51
1 #include "qbarcategory.h"
1 #include "qbarcategory.h"
2
2
3 QTCOMMERCIALCHART_BEGIN_NAMESPACE
3 QTCOMMERCIALCHART_BEGIN_NAMESPACE
4
4
5 /*!
5 /*!
6 \class QBarCategory
6 \class QBarCategory
7 \brief QtCommercial chart API.
7 \brief part of QtCommercial chart API.
8
8
9 QBarCategory is a container for labels of various bar charts. Before the
9 QBarCategory is a container for labels of various bar charts. Before the
10 bar chart can be constructed, the categories must be defined. This is done by
10 bar chart can be constructed, the categories must be defined. This is done by
11 creating a QBarCategory class and appending the labels of categories to it.
11 creating a QBarCategory class and appending the labels of categories to it.
12 The QBarCategory is then given to QBarSeries class.
12 The QBarCategory is then given to bar chart series class.
13
14 \sa QBarChartSeries, QStackedBarChartSeries, QPercentBarChartSeries
13 */
15 */
14
16
15 /*!
17 /*!
16 Constructs the category container
18 Constructs the category container
17 */
19 */
18 QBarCategory::QBarCategory()
20 QBarCategory::QBarCategory()
19 {
21 {
20 }
22 }
21
23
22 /*!
24 /*!
23 Appends the \a label in the category.
25 Appends the \a label in the category.
24 */
26 */
25 QBarCategory& QBarCategory::operator << (const QString &label)
27 QBarCategory& QBarCategory::operator << (const QString &label)
26 {
28 {
27 mList.append(label);
29 mList.append(label);
28 return *this;
30 return *this;
29 }
31 }
30
32
31 /*!
33 /*!
32 Retrurns number of labels in category
34 Retrurns number of labels in category
33 */
35 */
34 int QBarCategory::count()
36 int QBarCategory::count()
35 {
37 {
36 return mList.count();
38 return mList.count();
37 }
39 }
38
40
39 /*!
41 /*!
40 Retruns the label of category defined by index \a category
42 Retruns the label of category defined by index \a category
41 */
43 */
42 QString QBarCategory::label(int category)
44 QString QBarCategory::label(int category)
43 {
45 {
44 return mList.at(category);
46 return mList.at(category);
45 }
47 }
46
48
47 // TODO?:
49 // TODO?:
48 //#include "moc_qbarcategory.cpp"
50 //#include "moc_qbarcategory.cpp"
49 QTCOMMERCIALCHART_END_NAMESPACE
51 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,128 +1,232
1 #include <QDebug>
1 #include <QDebug>
2 #include "qbarchartseries.h"
2 #include "qbarchartseries.h"
3 #include "qbarcategory.h"
3 #include "qbarcategory.h"
4 #include "qbarset.h"
4 #include "qbarset.h"
5 #include "barchartmodel_p.h"
5 #include "barchartmodel_p.h"
6
6
7
7
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
9
9
10 /*!
11 \class QBarChartSeries
12 \brief part of QtCommercial chart API.
13
14 QBarChartSeries represents a series of data shown as bars. One QBarChartSeries can contain multible
15 QBarSet data sets. QBarChartSeries groups the data from sets to categories, which are defined
16 by QBarCategory class.
17
18 \sa QBarCategory, QBarSet, QStackedBarChartSeries, QPercentBarChartSeries
19 */
20
21 /*!
22 \fn virtual QChartSeriesType QBarChartSeries::type() const
23 \brief Returns type of series.
24 \sa QChartSeries, QChartSeriesType
25 */
26 /*!
27 \fn void QBarChartSeries::changed(int index)
28 \brief INTERNAL \a index
29 */
30 /*!
31 \fn void QBarChartSeries::floatingValuesEnabled(bool enabled)
32 \brief INTERNAL \a enabled
33 */
34 /*!
35 \fn void QBarChartSeries::toolTipEnabled(bool enabled)
36 \brief INTERNAL \a enabled
37 */
38 /*!
39 \fn void QBarChartSeries::separatorsEnabled(bool enabled)
40 \brief INTERNAL \a enabled
41 */
42 /*!
43 \fn void QBarChartSeries::showToolTip(QPoint pos, QString tip)
44 \brief INTERNAL \a pos \a tip
45 */
46
47 /*!
48 Constructs empty QBarChartSeries. Parameter \a category defines the categories for chart.
49 QBarChartSeries is QObject which is a child of a\a parent.
50 */
10 QBarChartSeries::QBarChartSeries(QBarCategory *category, QObject *parent)
51 QBarChartSeries::QBarChartSeries(QBarCategory *category, QObject *parent)
11 : QChartSeries(parent)
52 : QChartSeries(parent)
12 ,mModel(new BarChartModel(category, this))
53 ,mModel(new BarChartModel(category, this))
13 {
54 {
14 }
55 }
15
56
57 /*!
58 Adds a set of bars to series. Takes ownership of \a set
59 */
16 void QBarChartSeries::addBarSet(QBarSet *set)
60 void QBarChartSeries::addBarSet(QBarSet *set)
17 {
61 {
18 mModel->addBarSet(set);
62 mModel->addBarSet(set);
19 }
63 }
20
64
65 /*!
66 Removes a set of bars from series. Releases ownership of \a set. Doesnt delete \a set.
67 */
21 void QBarChartSeries::removeBarSet(QBarSet *set)
68 void QBarChartSeries::removeBarSet(QBarSet *set)
22 {
69 {
23 mModel->removeBarSet(set);
70 mModel->removeBarSet(set);
24 }
71 }
25
72
73 /*!
74 Returns number of sets in series.
75 */
26 int QBarChartSeries::countSets()
76 int QBarChartSeries::countSets()
27 {
77 {
28 return mModel->countSets();
78 return mModel->countSets();
29 }
79 }
30
80
81 /*!
82 Simple iterator for set. Returns pointer to next set in series.
83 Returns first set, if \a getFirst is true. If series is empty, returns 0.
84 */
31 QBarSet* QBarChartSeries::nextSet(bool getFirst)
85 QBarSet* QBarChartSeries::nextSet(bool getFirst)
32 {
86 {
33 return mModel->nextSet(getFirst);
87 return mModel->nextSet(getFirst);
34 }
88 }
35
89
90 /*!
91 Returns set indexed by \a index. Doesn't check for index bounds.
92 Assumes that \a index is between 0 and number of sets. Use countSets() to get valid index bound.
93 \sa countSets()
94 */
36 QBarSet* QBarChartSeries::setAt(int index)
95 QBarSet* QBarChartSeries::setAt(int index)
37 {
96 {
38 return mModel->setAt(index);
97 return mModel->setAt(index);
39 }
98 }
40
99
100 /*!
101 Returns legend of series. Legend is a list of set names in series.
102 */
41 QList<QString> QBarChartSeries::legend()
103 QList<QString> QBarChartSeries::legend()
42 {
104 {
43 return mModel->legend();
105 return mModel->legend();
44 }
106 }
45
107
108 /*!
109 INTERNAL \a category
110 */
46 QString QBarChartSeries::label(int category)
111 QString QBarChartSeries::label(int category)
47 {
112 {
48 return mModel->label(category);
113 return mModel->label(category);
49 }
114 }
50
115
116 /*!
117 Enables or disables floating values depending on parameter \a enabled.
118 Floating values are bar values, that are displayed on top of each bar.
119 Calling without parameter \a enabled, enables the floating values
120 */
51 void QBarChartSeries::enableFloatingValues(bool enabled)
121 void QBarChartSeries::enableFloatingValues(bool enabled)
52 {
122 {
53 if (enabled) {
123 if (enabled) {
54 for (int i=0; i<mModel->countSets(); i++) {
124 for (int i=0; i<mModel->countSets(); i++) {
55 QBarSet *set = mModel->setAt(i);
125 QBarSet *set = mModel->setAt(i);
56 connect(set,SIGNAL(clicked()),set,SIGNAL(toggleFloatingValues()));
126 connect(set,SIGNAL(clicked()),set,SIGNAL(toggleFloatingValues()));
57 }
127 }
58 } else {
128 } else {
59 for (int i=0; i<mModel->countSets(); i++) {
129 for (int i=0; i<mModel->countSets(); i++) {
60 QBarSet *set = mModel->setAt(i);
130 QBarSet *set = mModel->setAt(i);
61 disconnect(set,SIGNAL(clicked()),set,SIGNAL(toggleFloatingValues()));
131 disconnect(set,SIGNAL(clicked()),set,SIGNAL(toggleFloatingValues()));
62 }
132 }
63 }
133 }
64 }
134 }
65
135
136 /*!
137 Enables or disables tooltip depending on parameter \a enabled.
138 Tooltip shows the name of set, when mouse is hovering on top of bar.
139 Calling without parameter \a enabled, enables the tooltip
140 */
66 void QBarChartSeries::enableToolTip(bool enabled)
141 void QBarChartSeries::enableToolTip(bool enabled)
67 {
142 {
68 if (enabled) {
143 if (enabled) {
69 for (int i=0; i<mModel->countSets(); i++) {
144 for (int i=0; i<mModel->countSets(); i++) {
70 QBarSet *set = mModel->setAt(i);
145 QBarSet *set = mModel->setAt(i);
71 connect(set,SIGNAL(showToolTip(QPoint,QString)),this,SIGNAL(showToolTip(QPoint,QString)));
146 connect(set,SIGNAL(showToolTip(QPoint,QString)),this,SIGNAL(showToolTip(QPoint,QString)));
72 }
147 }
73 } else {
148 } else {
74 for (int i=0; i<mModel->countSets(); i++) {
149 for (int i=0; i<mModel->countSets(); i++) {
75 QBarSet *set = mModel->setAt(i);
150 QBarSet *set = mModel->setAt(i);
76 disconnect(set,SIGNAL(showToolTip(QPoint,QString)),this,SIGNAL(showToolTip(QPoint,QString)));
151 disconnect(set,SIGNAL(showToolTip(QPoint,QString)),this,SIGNAL(showToolTip(QPoint,QString)));
77 }
152 }
78 }
153 }
79 }
154 }
80
155
156 /*!
157 Enables or disables separators depending on parameter \a enabled.
158 Separators are visual elements that are drawn between categories.
159 Calling without parameter \a enabled, enables the separators
160 */
81 void QBarChartSeries::enableSeparators(bool enabled)
161 void QBarChartSeries::enableSeparators(bool enabled)
82 {
162 {
83 emit separatorsEnabled(enabled);
163 emit separatorsEnabled(enabled);
84 }
164 }
85
165
166 /*!
167 INTERNAL
168 */
86 int QBarChartSeries::countCategories()
169 int QBarChartSeries::countCategories()
87 {
170 {
88 return mModel->countCategories();
171 return mModel->countCategories();
89 }
172 }
90
173
174 /*!
175 INTERNAL
176 */
91 qreal QBarChartSeries::min()
177 qreal QBarChartSeries::min()
92 {
178 {
93 return mModel->min();
179 return mModel->min();
94 }
180 }
95
181
182 /*!
183 INTERNAL
184 */
96 qreal QBarChartSeries::max()
185 qreal QBarChartSeries::max()
97 {
186 {
98 return mModel->max();
187 return mModel->max();
99 }
188 }
100
189
190 /*!
191 INTERNAL \a set \a category
192 */
101 qreal QBarChartSeries::valueAt(int set, int category)
193 qreal QBarChartSeries::valueAt(int set, int category)
102 {
194 {
103 return mModel->valueAt(set,category);
195 return mModel->valueAt(set,category);
104 }
196 }
105
197
198 /*!
199 INTERNAL \a set \a category
200 */
106 qreal QBarChartSeries::percentageAt(int set, int category)
201 qreal QBarChartSeries::percentageAt(int set, int category)
107 {
202 {
108 return mModel->percentageAt(set,category);
203 return mModel->percentageAt(set,category);
109 }
204 }
110
205
206 /*!
207 INTERNAL \a category
208 */
111 qreal QBarChartSeries::categorySum(int category)
209 qreal QBarChartSeries::categorySum(int category)
112 {
210 {
113 return mModel->categorySum(category);
211 return mModel->categorySum(category);
114 }
212 }
115
213
214 /*!
215 INTERNAL
216 */
116 qreal QBarChartSeries::maxCategorySum()
217 qreal QBarChartSeries::maxCategorySum()
117 {
218 {
118 return mModel->maxCategorySum();
219 return mModel->maxCategorySum();
119 }
220 }
120
221
222 /*!
223 INTERNAL
224 */
121 BarChartModel& QBarChartSeries::model()
225 BarChartModel& QBarChartSeries::model()
122 {
226 {
123 return *mModel;
227 return *mModel;
124 }
228 }
125
229
126 #include "moc_qbarchartseries.cpp"
230 #include "moc_qbarchartseries.cpp"
127
231
128 QTCOMMERCIALCHART_END_NAMESPACE
232 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,66 +1,66
1 #ifndef BARCHARTSERIES_H
1 #ifndef BARCHARTSERIES_H
2 #define BARCHARTSERIES_H
2 #define BARCHARTSERIES_H
3
3
4 #include "qchartseries.h"
4 #include "qchartseries.h"
5
5
6 QTCOMMERCIALCHART_BEGIN_NAMESPACE
6 QTCOMMERCIALCHART_BEGIN_NAMESPACE
7
7
8 class QBarCategory;
8 class QBarCategory;
9 class QBarSet;
9 class QBarSet;
10 class BarChartModel;
10 class BarChartModel;
11
11
12 // Container for series
12 // Container for series
13 class QTCOMMERCIALCHART_EXPORT QBarChartSeries : public QChartSeries
13 class QTCOMMERCIALCHART_EXPORT QBarChartSeries : public QChartSeries
14 {
14 {
15 Q_OBJECT
15 Q_OBJECT
16 public:
16 public:
17 QBarChartSeries(QBarCategory *category, QObject* parent=0);
17 QBarChartSeries(QBarCategory *category, QObject* parent=0);
18
18
19 virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; }
19 virtual QChartSeriesType type() const { return QChartSeries::SeriesTypeBar; }
20
20
21 void addBarSet(QBarSet *set); // Takes ownership of set
21 void addBarSet(QBarSet *set); // Takes ownership of set
22 void removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set
22 void removeBarSet(QBarSet *set); // Releases ownership, doesn't delete set
23 int countSets();
23 int countSets();
24 QBarSet* nextSet(bool getFirst=false); // Returns first set, if called with true
24 QBarSet* nextSet(bool getFirst=false); // Returns first set, if called with true
25 QBarSet *setAt(int index);
25 QBarSet *setAt(int index);
26
26
27 QList<QString> legend(); // Returns legend of series (ie. names of all sets in series)
27 QList<QString> legend(); // Returns legend of series (ie. names of all sets in series)
28 QString label(int category);
29
28
30 public:
29 public:
31 // TODO: Functions below this are not part of api and will be moved
30 // TODO: Functions below this are not part of api and will be moved
32 // to private implementation, when we start using it
31 // to private implementation, when we start using it
33 // TODO: TO PIMPL --->
32 // TODO: TO PIMPL --->
33 QString label(int category);
34 int countCategories();
34 int countCategories();
35 qreal min();
35 qreal min();
36 qreal max();
36 qreal max();
37 qreal valueAt(int set, int category);
37 qreal valueAt(int set, int category);
38 qreal percentageAt(int set, int category);
38 qreal percentageAt(int set, int category);
39 qreal categorySum(int category);
39 qreal categorySum(int category);
40 qreal maxCategorySum();
40 qreal maxCategorySum();
41 BarChartModel& model();
41 BarChartModel& model();
42 // <--- TO PIMPL
42 // <--- TO PIMPL
43
43
44 signals:
44 signals:
45 void changed(int index);
45 void changed(int index);
46
46
47 // TODO: internal signals, these to private implementation.
47 // TODO: internal signals, these to private implementation.
48 // TODO: TO PIMPL --->
48 // TODO: TO PIMPL --->
49 void floatingValuesEnabled(bool enabled);
49 void floatingValuesEnabled(bool enabled);
50 void toolTipEnabled(bool enabled);
50 void toolTipEnabled(bool enabled);
51 void separatorsEnabled(bool enabled);
51 void separatorsEnabled(bool enabled);
52 void showToolTip(QPoint pos, QString tip);
52 void showToolTip(QPoint pos, QString tip);
53 // <--- TO PIMPL
53 // <--- TO PIMPL
54
54
55 public Q_SLOTS:
55 public Q_SLOTS:
56 void enableFloatingValues(bool enabled=true); // enables floating values on top of bars
56 void enableFloatingValues(bool enabled=true); // enables floating values on top of bars
57 void enableToolTip(bool enabled=true); // enables tooltips
57 void enableToolTip(bool enabled=true); // enables tooltips
58 void enableSeparators(bool enabled=true); // enables separators between categories
58 void enableSeparators(bool enabled=true); // enables separators between categories
59
59
60 protected:
60 protected:
61 BarChartModel* mModel;
61 BarChartModel* mModel;
62 };
62 };
63
63
64 QTCOMMERCIALCHART_END_NAMESPACE
64 QTCOMMERCIALCHART_END_NAMESPACE
65
65
66 #endif // BARCHARTSERIES_H
66 #endif // BARCHARTSERIES_H
@@ -1,88 +1,165
1 #include "qbarset.h"
1 #include "qbarset.h"
2 #include <QDebug>
2 #include <QDebug>
3 #include <QToolTip>
3 #include <QToolTip>
4
4
5 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5 QTCOMMERCIALCHART_BEGIN_NAMESPACE
6
6
7 /*!
8 \class QBarSet
9 \brief part of QtCommercial chart API.
10
11 QBarSet represents one set of bars. Set of bars contains one data value for each category.
12 First value of set is assumed to belong to first category, second to second category and so on.
13 If set has fewer values than there are categories, then the missing values are assumed to be
14 at the end of set. For missing values in middle of a set, numerical value of zero is used.
15
16 \sa QBarCategory, QBarChartSeries, QStackedBarChartSeries, QPercentBarChartSeries
17 */
18
19 /*!
20 \fn void QBarSet::clicked()
21 \brief signals that set has been clicked
22 */
23 /*!
24 \fn void QBarSet::hoverEnter(QPoint pos)
25 \brief signals that mouse has entered over the set at position \a pos.
26 */
27 /*!
28 \fn void QBarSet::hoverLeave()
29 \brief signals that mouse has left from the set.
30 */
31 /*!
32 \fn void QBarSet::toggleFloatingValues()
33 \brief INTERNAL
34 */
35 /*!
36 \fn void QBarSet::showToolTip(QPoint pos, QString tip)
37 \brief INTERNAL \a pos \a tip
38 */
39
40
41 /*!
42 Constructs QBarSet with a name of \a name and with parent of \a parent
43 */
7 QBarSet::QBarSet(QString name, QObject *parent)
44 QBarSet::QBarSet(QString name, QObject *parent)
8 : QObject(parent)
45 : QObject(parent)
9 ,mName(name)
46 ,mName(name)
10 {
47 {
11 }
48 }
12
49
50 /*!
51 Sets new \a name for set.
52 */
13 void QBarSet::setName(QString name)
53 void QBarSet::setName(QString name)
14 {
54 {
15 mName = name;
55 mName = name;
16 }
56 }
57
58 /*!
59 Returns name of the set.
60 */
17 QString QBarSet::name()
61 QString QBarSet::name()
18 {
62 {
19 return mName;
63 return mName;
20 }
64 }
21
65
66 /*!
67 Appends new value \a value to the end of set.
68 */
22 QBarSet& QBarSet::operator << (const qreal &value)
69 QBarSet& QBarSet::operator << (const qreal &value)
23 {
70 {
24 mValues.append(value);
71 mValues.append(value);
25 return *this;
72 return *this;
26 }
73 }
27
74
75 /*!
76 Returns count of values in set.
77 */
28 int QBarSet::count()
78 int QBarSet::count()
29 {
79 {
30 return mValues.count();
80 return mValues.count();
31 }
81 }
32
82
83 /*!
84 Returns value of set indexed by \a index
85 */
33 qreal QBarSet::valueAt(int index)
86 qreal QBarSet::valueAt(int index)
34 {
87 {
35 return mValues.at(index);
88 return mValues.at(index);
36 }
89 }
37
90
91 /*!
92 Sets a new value \a value to set, indexed by \a index
93 */
38 void QBarSet::setValue(int index, qreal value)
94 void QBarSet::setValue(int index, qreal value)
39 {
95 {
40 mValues.replace(index,value);
96 mValues.replace(index,value);
41 }
97 }
42
98
99 /*!
100 Sets pen for set. Bars of this set are drawn using \a pen
101 */
43 void QBarSet::setPen(const QPen& pen)
102 void QBarSet::setPen(const QPen& pen)
44 {
103 {
45 mPen = pen;
104 mPen = pen;
46 }
105 }
47
106
107 /*!
108 Returns pen of the set.
109 */
48 const QPen& QBarSet::pen() const
110 const QPen& QBarSet::pen() const
49 {
111 {
50 return mPen;
112 return mPen;
51 }
113 }
52
114
115 /*!
116 Sets brush for the set. Bars of this set are drawn using \a brush
117 */
53 void QBarSet::setBrush(const QBrush& brush)
118 void QBarSet::setBrush(const QBrush& brush)
54 {
119 {
55 mBrush = brush;
120 mBrush = brush;
56 }
121 }
57
122
123 /*!
124 Returns brush of the set.
125 */
58 const QBrush& QBarSet::brush() const
126 const QBrush& QBarSet::brush() const
59 {
127 {
60 return mBrush;
128 return mBrush;
61 }
129 }
62
130
131 /*!
132 INTERNAL
133 */
63 void QBarSet::barClicked()
134 void QBarSet::barClicked()
64 {
135 {
65 // qDebug() << "QBarset::barClicked" << this;
136 // qDebug() << "QBarset::barClicked" << this;
66 // Some bar of this set has been clicked
137 // Some bar of this set has been clicked
67 // TODO: What happens then?
138 // TODO: What happens then?
68 emit clicked(); // Notify that set has been clicked
139 emit clicked(); // Notify that set has been clicked
69 }
140 }
70
141
142 /*!
143 INTERNAL \a pos
144 */
71 void QBarSet::barHoverEntered(QPoint pos)
145 void QBarSet::barHoverEntered(QPoint pos)
72 {
146 {
73 emit showToolTip(pos, mName);
147 emit showToolTip(pos, mName);
74 emit hoverEnter(pos);
148 emit hoverEnter(pos);
75 }
149 }
76
150
151 /*!
152 INTERNAL
153 */
77 void QBarSet::barHoverLeaved()
154 void QBarSet::barHoverLeaved()
78 {
155 {
79 // qDebug() << "QBarset::barHoverLeaved" << this;
156 // qDebug() << "QBarset::barHoverLeaved" << this;
80 // if (mToolTipEnabled) {
157 // if (mToolTipEnabled) {
81 // TODO: do what?
158 // TODO: do what?
82 // }
159 // }
83 // Emit signal to user of charts
160 // Emit signal to user of charts
84 emit hoverLeave();
161 emit hoverLeave();
85 }
162 }
86
163
87 #include "moc_qbarset.cpp"
164 #include "moc_qbarset.cpp"
88 QTCOMMERCIALCHART_END_NAMESPACE
165 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,13 +1,34
1 #include "qpercentbarchartseries.h"
1 #include "qpercentbarchartseries.h"
2
2
3 QTCOMMERCIALCHART_BEGIN_NAMESPACE
3 QTCOMMERCIALCHART_BEGIN_NAMESPACE
4
4
5 /*!
6 \class QPercentBarChartSeries
7 \brief part of QtCommercial chart API.
8
9 QPercentBarChartSeries represents a series of data shown as bars. Each bar of QBarSet is shown as percentage
10 of all bars in category. One QPercentBarChartSeries can contain multible QBarSet data sets.
11 QBarChartSeries groups the data from sets to categories, which are defined by QBarCategory class.
12
13 \sa QBarCategory, QBarSet, QStackedBarChartSeries, QBarChartSeries
14 */
15
16 /*!
17 \fn virtual QChartSeriesType QPercentBarChartSeries::type() const
18 \brief Returns type of series.
19 \sa QChartSeries, QChartSeriesType
20 */
21
22 /*!
23 Constructs empty QPercentBarChartSeries. Parameter \a category defines the categories for chart.
24 QPercentBarChartSeries is QObject which is a child of a\a parent.
25 */
5 QPercentBarChartSeries::QPercentBarChartSeries(QBarCategory *category, QObject *parent)
26 QPercentBarChartSeries::QPercentBarChartSeries(QBarCategory *category, QObject *parent)
6 : QBarChartSeries(category, parent)
27 : QBarChartSeries(category, parent)
7 {
28 {
8 }
29 }
9
30
10 #include "moc_qpercentbarchartseries.cpp"
31 #include "moc_qpercentbarchartseries.cpp"
11
32
12 QTCOMMERCIALCHART_END_NAMESPACE
33 QTCOMMERCIALCHART_END_NAMESPACE
13
34
@@ -1,13 +1,34
1 #include "qstackedbarchartseries.h"
1 #include "qstackedbarchartseries.h"
2
2
3 QTCOMMERCIALCHART_BEGIN_NAMESPACE
3 QTCOMMERCIALCHART_BEGIN_NAMESPACE
4
4
5 /*!
6 \class QStackedBarChartSeries
7 \brief part of QtCommercial chart API.
8
9 QStackedBarChartSeries represents a series of data shown as bars. All bars in same category are
10 stacked on top of each other. One QStackedBarChartSeries can contain multible QBarSet data sets.
11 QStackedBarChartSeries groups the data from sets to categories, which are defined by QBarCategory class.
12
13 \sa QBarCategory, QBarSet, QPercentBarChartSeries, QBarChartSeries
14 */
15
16 /*!
17 \fn virtual QChartSeriesType QStackedBarChartSeries::type() const
18 \brief Returns type of series.
19 \sa QChartSeries, QChartSeriesType
20 */
21
22 /*!
23 Constructs empty QStackedBarChartSeries. Parameter \a category defines the categories for chart.
24 QStackedBarChartSeries is QObject which is a child of a\a parent.
25 */
5 QStackedBarChartSeries::QStackedBarChartSeries(QBarCategory *category, QObject *parent)
26 QStackedBarChartSeries::QStackedBarChartSeries(QBarCategory *category, QObject *parent)
6 : QBarChartSeries(category, parent)
27 : QBarChartSeries(category, parent)
7 {
28 {
8 }
29 }
9
30
10 #include "moc_qstackedbarchartseries.cpp"
31 #include "moc_qstackedbarchartseries.cpp"
11
32
12 QTCOMMERCIALCHART_END_NAMESPACE
33 QTCOMMERCIALCHART_END_NAMESPACE
13
34
General Comments 0
You need to be logged in to leave comments. Login now