@@ -4,23 +4,21 DEPENDPATH += $$PWD | |||||
4 | SOURCES += \ |
|
4 | SOURCES += \ | |
5 | $$PWD/bar.cpp \ |
|
5 | $$PWD/bar.cpp \ | |
6 | $$PWD/barchartmodel.cpp \ |
|
6 | $$PWD/barchartmodel.cpp \ | |
7 |
$$PWD/bar |
|
7 | $$PWD/barchartitem.cpp \ | |
8 |
$$PWD/ |
|
8 | $$PWD/percentbarchartitem.cpp \ | |
9 | $$PWD/percentbarpresenter.cpp \ |
|
|||
10 | $$PWD/qbarseries.cpp \ |
|
9 | $$PWD/qbarseries.cpp \ | |
11 | $$PWD/qbarset.cpp \ |
|
10 | $$PWD/qbarset.cpp \ | |
12 | $$PWD/qpercentbarseries.cpp \ |
|
11 | $$PWD/qpercentbarseries.cpp \ | |
13 | $$PWD/qstackedbarseries.cpp \ |
|
12 | $$PWD/qstackedbarseries.cpp \ | |
14 |
$$PWD/stackedbar |
|
13 | $$PWD/stackedbarchartitem.cpp \ | |
15 | $$PWD/barvalue.cpp |
|
14 | $$PWD/barvalue.cpp | |
16 |
|
15 | |||
17 | PRIVATE_HEADERS += \ |
|
16 | PRIVATE_HEADERS += \ | |
18 | $$PWD/bar_p.h \ |
|
17 | $$PWD/bar_p.h \ | |
19 | $$PWD/barchartmodel_p.h \ |
|
18 | $$PWD/barchartmodel_p.h \ | |
20 |
$$PWD/bar |
|
19 | $$PWD/barchartitem_p.h \ | |
21 |
$$PWD/ |
|
20 | $$PWD/percentbarchartitem_p.h \ | |
22 |
$$PWD/ |
|
21 | $$PWD/stackedbarchartitem_p.h \ | |
23 | $$PWD/stackedbarpresenter_p.h \ |
|
|||
24 | $$PWD/barvalue_p.h |
|
22 | $$PWD/barvalue_p.h | |
25 |
|
23 | |||
26 | PUBLIC_HEADERS += \ |
|
24 | PUBLIC_HEADERS += \ |
@@ -1,4 +1,4 | |||||
1 |
#include "bar |
|
1 | #include "barchartitem_p.h" | |
2 | #include "bar_p.h" |
|
2 | #include "bar_p.h" | |
3 | #include "barvalue_p.h" |
|
3 | #include "barvalue_p.h" | |
4 | #include "qbarset.h" |
|
4 | #include "qbarset.h" | |
@@ -12,7 +12,7 | |||||
12 |
|
12 | |||
13 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
13 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
14 |
|
14 | |||
15 |
Bar |
|
15 | BarChartItem::BarChartItem(QBarSeries *series, QChart *parent) : | |
16 | ChartItem(parent), |
|
16 | ChartItem(parent), | |
17 | mHeight(0), |
|
17 | mHeight(0), | |
18 | mWidth(0), |
|
18 | mWidth(0), | |
@@ -21,20 +21,21 BarPresenterBase::BarPresenterBase(QBarSeries *series, QChart *parent) : | |||||
21 | mChart(parent) |
|
21 | mChart(parent) | |
22 | { |
|
22 | { | |
23 | connect(series,SIGNAL(showToolTip(QPoint,QString)),this,SLOT(showToolTip(QPoint,QString))); |
|
23 | connect(series,SIGNAL(showToolTip(QPoint,QString)),this,SLOT(showToolTip(QPoint,QString))); | |
|
24 | connect(series, SIGNAL(updatedBars()), this, SLOT(layoutChanged())); | |||
24 | setZValue(ChartPresenter::BarSeriesZValue); |
|
25 | setZValue(ChartPresenter::BarSeriesZValue); | |
25 | initAxisLabels(); |
|
26 | initAxisLabels(); | |
26 | dataChanged(); |
|
27 | dataChanged(); | |
27 | } |
|
28 | } | |
28 |
|
29 | |||
29 | BarPresenterBase::~BarPresenterBase() |
|
30 | BarChartItem::~BarChartItem() | |
30 | { |
|
31 | { | |
31 | disconnect(this,SLOT(showToolTip(QPoint,QString))); |
|
32 | disconnect(this,SLOT(showToolTip(QPoint,QString))); | |
32 | } |
|
33 | } | |
33 |
|
34 | |||
34 |
void Bar |
|
35 | void BarChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | |
35 | { |
|
36 | { | |
36 | if (!mLayoutSet) { |
|
37 | if (!mLayoutSet) { | |
37 |
qDebug() << "Bar |
|
38 | qDebug() << "BarChartItem::paint called without layout set. Aborting."; | |
38 | return; |
|
39 | return; | |
39 | } |
|
40 | } | |
40 | foreach(QGraphicsItem* i, childItems()) { |
|
41 | foreach(QGraphicsItem* i, childItems()) { | |
@@ -42,12 +43,12 void BarPresenterBase::paint(QPainter *painter, const QStyleOptionGraphicsItem * | |||||
42 | } |
|
43 | } | |
43 | } |
|
44 | } | |
44 |
|
45 | |||
45 |
QRectF Bar |
|
46 | QRectF BarChartItem::boundingRect() const | |
46 | { |
|
47 | { | |
47 | return QRectF(0, 0, mWidth, mHeight); |
|
48 | return QRectF(0, 0, mWidth, mHeight); | |
48 | } |
|
49 | } | |
49 |
|
50 | |||
50 |
void Bar |
|
51 | void BarChartItem::dataChanged() | |
51 | { |
|
52 | { | |
52 | // TODO: performance optimizations. Do we really need to delete and create items every time data is changed or can we reuse them? |
|
53 | // TODO: performance optimizations. Do we really need to delete and create items every time data is changed or can we reuse them? | |
53 | // Delete old bars |
|
54 | // Delete old bars | |
@@ -85,7 +86,79 void BarPresenterBase::dataChanged() | |||||
85 | } |
|
86 | } | |
86 | } |
|
87 | } | |
87 |
|
88 | |||
88 | void BarPresenterBase::initAxisLabels() |
|
89 | void BarChartItem::layoutChanged() | |
|
90 | { | |||
|
91 | // Scale bars to new layout | |||
|
92 | // Layout for bars: | |||
|
93 | if (mSeries->barsetCount() <= 0) { | |||
|
94 | qDebug() << "No sets in model!"; | |||
|
95 | return; | |||
|
96 | } | |||
|
97 | ||||
|
98 | if (childItems().count() == 0) { | |||
|
99 | qDebug() << "WARNING: BarChartitem::layoutChanged called before graphics items are created!"; | |||
|
100 | return; | |||
|
101 | } | |||
|
102 | ||||
|
103 | // Use temporary qreals for accurancy (we might get some compiler warnings... :) | |||
|
104 | int categoryCount = mSeries->categoryCount(); | |||
|
105 | int setCount = mSeries->barsetCount(); | |||
|
106 | ||||
|
107 | qreal tW = mWidth; | |||
|
108 | qreal tH = mHeight; | |||
|
109 | qreal tM = mSeries->max(); | |||
|
110 | qreal scale = (tH/tM); | |||
|
111 | qreal tC = categoryCount + 1; | |||
|
112 | qreal categoryWidth = tW/tC; | |||
|
113 | mBarWidth = categoryWidth / (setCount+1); | |||
|
114 | ||||
|
115 | int itemIndex(0); | |||
|
116 | for (int category=0; category < categoryCount; category++) { | |||
|
117 | qreal xPos = categoryWidth * category + categoryWidth /2 + mBarWidth/2; | |||
|
118 | qreal yPos = mHeight; | |||
|
119 | for (int set = 0; set < setCount; set++) { | |||
|
120 | qreal barHeight = mSeries->valueAt(set,category) * scale; | |||
|
121 | Bar* bar = mBars.at(itemIndex); | |||
|
122 | ||||
|
123 | // TODO: width settable per bar? | |||
|
124 | bar->resize(mBarWidth, barHeight); | |||
|
125 | bar->setPen(mSeries->barsetAt(set)->pen()); | |||
|
126 | bar->setBrush(mSeries->barsetAt(set)->brush()); | |||
|
127 | bar->setPos(xPos, yPos-barHeight); | |||
|
128 | itemIndex++; | |||
|
129 | xPos += mBarWidth; | |||
|
130 | } | |||
|
131 | } | |||
|
132 | ||||
|
133 | // Position floating values | |||
|
134 | itemIndex = 0; | |||
|
135 | for (int category=0; category < mSeries->categoryCount(); category++) { | |||
|
136 | qreal xPos = categoryWidth * category + categoryWidth/2 + mBarWidth; | |||
|
137 | qreal yPos = mHeight; | |||
|
138 | for (int set=0; set < mSeries->barsetCount(); set++) { | |||
|
139 | qreal barHeight = mSeries->valueAt(set,category) * scale; | |||
|
140 | BarValue* value = mFloatingValues.at(itemIndex); | |||
|
141 | ||||
|
142 | QBarSet* barSet = mSeries->barsetAt(set); | |||
|
143 | value->resize(100,50); // TODO: proper layout for this. | |||
|
144 | value->setPos(xPos, yPos-barHeight/2); | |||
|
145 | value->setPen(barSet->floatingValuePen()); | |||
|
146 | ||||
|
147 | if (mSeries->valueAt(set,category) != 0) { | |||
|
148 | value->setValueString(QString::number(mSeries->valueAt(set,category))); | |||
|
149 | } else { | |||
|
150 | value->setValueString(QString("")); | |||
|
151 | } | |||
|
152 | ||||
|
153 | itemIndex++; | |||
|
154 | xPos += mBarWidth; | |||
|
155 | } | |||
|
156 | } | |||
|
157 | update(); | |||
|
158 | } | |||
|
159 | ||||
|
160 | ||||
|
161 | void BarChartItem::initAxisLabels() | |||
89 | { |
|
162 | { | |
90 | int count = mSeries->categoryCount(); |
|
163 | int count = mSeries->categoryCount(); | |
91 | if (0 == count) { |
|
164 | if (0 == count) { | |
@@ -113,13 +186,13 void BarPresenterBase::initAxisLabels() | |||||
113 |
|
186 | |||
114 | //handlers |
|
187 | //handlers | |
115 |
|
188 | |||
116 |
void Bar |
|
189 | void BarChartItem::handleModelChanged(int index) | |
117 | { |
|
190 | { | |
118 | Q_UNUSED(index) |
|
191 | Q_UNUSED(index) | |
119 | dataChanged(); |
|
192 | dataChanged(); | |
120 | } |
|
193 | } | |
121 |
|
194 | |||
122 |
void Bar |
|
195 | void BarChartItem::handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY) | |
123 | { |
|
196 | { | |
124 | // TODO: |
|
197 | // TODO: | |
125 | Q_UNUSED(minX) |
|
198 | Q_UNUSED(minX) | |
@@ -146,7 +219,7 void BarPresenterBase::handleDomainChanged(qreal minX, qreal maxX, qreal minY, q | |||||
146 | */ |
|
219 | */ | |
147 | } |
|
220 | } | |
148 |
|
221 | |||
149 |
void Bar |
|
222 | void BarChartItem::handleGeometryChanged(const QRectF& rect) | |
150 | { |
|
223 | { | |
151 | mWidth = rect.width(); |
|
224 | mWidth = rect.width(); | |
152 | mHeight = rect.height(); |
|
225 | mHeight = rect.height(); | |
@@ -155,12 +228,12 void BarPresenterBase::handleGeometryChanged(const QRectF& rect) | |||||
155 | setPos(rect.topLeft()); |
|
228 | setPos(rect.topLeft()); | |
156 | } |
|
229 | } | |
157 |
|
230 | |||
158 |
void Bar |
|
231 | void BarChartItem::showToolTip(QPoint pos, QString tip) | |
159 | { |
|
232 | { | |
160 | // TODO: cool tooltip instead of default |
|
233 | // TODO: cool tooltip instead of default | |
161 | QToolTip::showText(pos,tip); |
|
234 | QToolTip::showText(pos,tip); | |
162 | } |
|
235 | } | |
163 |
|
236 | |||
164 |
#include "moc_bar |
|
237 | #include "moc_barchartitem_p.cpp" | |
165 |
|
238 | |||
166 | QTCOMMERCIALCHART_END_NAMESPACE |
|
239 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,5 +1,5 | |||||
1 |
#ifndef BAR |
|
1 | #ifndef BARCHARTITEM_H | |
2 |
#define BAR |
|
2 | #define BARCHARTITEM_H | |
3 |
|
3 | |||
4 | #include "chartitem_p.h" |
|
4 | #include "chartitem_p.h" | |
5 | #include "qbarseries.h" |
|
5 | #include "qbarseries.h" | |
@@ -14,14 +14,13 class BarValue; | |||||
14 | class QChartAxisCategories; |
|
14 | class QChartAxisCategories; | |
15 | class QChart; |
|
15 | class QChart; | |
16 |
|
16 | |||
17 |
// Common implemantation of different presenters. |
|
17 | // Common implemantation of different presenters. | |
18 | // TODO: combine this with BarPresenter and derive other presenters from it? |
|
18 | class BarChartItem : public QObject, public ChartItem | |
19 | class BarPresenterBase : public QObject, public ChartItem |
|
|||
20 | { |
|
19 | { | |
21 | Q_OBJECT |
|
20 | Q_OBJECT | |
22 | public: |
|
21 | public: | |
23 |
Bar |
|
22 | BarChartItem(QBarSeries *series, QChart *parent = 0); | |
24 |
virtual ~Bar |
|
23 | virtual ~BarChartItem(); | |
25 |
|
24 | |||
26 | public: |
|
25 | public: | |
27 | // From QGraphicsItem |
|
26 | // From QGraphicsItem | |
@@ -31,7 +30,7 public: | |||||
31 | // TODO: Consider the domain for layoutChanged. May be use case, may not be. If it is, then the derived classes need to implement it |
|
30 | // TODO: Consider the domain for layoutChanged. May be use case, may not be. If it is, then the derived classes need to implement it | |
32 | virtual void dataChanged(); // data of series has changed -> need to recalculate bar sizes |
|
31 | virtual void dataChanged(); // data of series has changed -> need to recalculate bar sizes | |
33 | private slots: |
|
32 | private slots: | |
34 |
virtual void layoutChanged() |
|
33 | virtual void layoutChanged(); // layout has changed -> need to recalculate bar sizes | |
35 |
|
34 | |||
36 | protected: |
|
35 | protected: | |
37 | void initAxisLabels(); |
|
36 | void initAxisLabels(); | |
@@ -62,4 +61,4 protected: | |||||
62 |
|
61 | |||
63 | QTCOMMERCIALCHART_END_NAMESPACE |
|
62 | QTCOMMERCIALCHART_END_NAMESPACE | |
64 |
|
63 | |||
65 |
#endif // BAR |
|
64 | #endif // BARCHARTITEM_H |
@@ -1,4 +1,4 | |||||
1 |
#include "percentbar |
|
1 | #include "percentbarchartitem_p.h" | |
2 | #include "bar_p.h" |
|
2 | #include "bar_p.h" | |
3 | #include "barvalue_p.h" |
|
3 | #include "barvalue_p.h" | |
4 | #include "qbarset.h" |
|
4 | #include "qbarset.h" | |
@@ -7,12 +7,12 | |||||
7 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
7 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
8 |
|
8 | |||
9 |
|
9 | |||
10 |
PercentBar |
|
10 | PercentBarChartItem::PercentBarChartItem(QBarSeries *series, QChart *parent) : | |
11 |
Bar |
|
11 | BarChartItem(series, parent) | |
12 | { |
|
12 | { | |
13 | } |
|
13 | } | |
14 |
|
14 | |||
15 |
void PercentBar |
|
15 | void PercentBarChartItem::layoutChanged() | |
16 | { |
|
16 | { | |
17 | // Scale bars to new layout |
|
17 | // Scale bars to new layout | |
18 | // Layout for bars: |
|
18 | // Layout for bars: | |
@@ -23,7 +23,7 void PercentBarPresenter::layoutChanged() | |||||
23 | } |
|
23 | } | |
24 |
|
24 | |||
25 | if (childItems().count() == 0) { |
|
25 | if (childItems().count() == 0) { | |
26 |
qDebug() << "WARNING: PercentBar |
|
26 | qDebug() << "WARNING: PercentBarChartItem::layoutChanged called before graphics items are created!"; | |
27 | return; |
|
27 | return; | |
28 | } |
|
28 | } | |
29 |
|
29 | |||
@@ -89,6 +89,6 void PercentBarPresenter::layoutChanged() | |||||
89 | } |
|
89 | } | |
90 | } |
|
90 | } | |
91 |
|
91 | |||
92 |
#include "moc_percentbar |
|
92 | #include "moc_percentbarchartitem_p.cpp" | |
93 |
|
93 | |||
94 | QTCOMMERCIALCHART_END_NAMESPACE |
|
94 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,30 +1,28 | |||||
1 |
#ifndef |
|
1 | #ifndef PERCENTBARCHARTITEM_H | |
2 |
#define |
|
2 | #define PERCENTBARCHARTITEM_H | |
3 |
|
3 | |||
4 |
#include " |
|
4 | #include "barchartitem_p.h" | |
5 | #include "barpresenterbase_p.h" |
|
|||
6 | #include <QGraphicsItem> |
|
5 | #include <QGraphicsItem> | |
7 |
|
6 | |||
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
7 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
9 |
|
8 | |||
10 | class QBarSeries; |
|
9 | class QBarSeries; | |
11 |
|
10 | |||
12 | // Presenter for parallel bars. Grouping of bars is done on category basis. |
|
11 | class PercentBarChartItem : public BarChartItem | |
13 | class BarPresenter : public BarPresenterBase |
|
|||
14 | { |
|
12 | { | |
15 | Q_OBJECT |
|
13 | Q_OBJECT | |
16 | public: |
|
14 | public: | |
17 |
|
|
15 | PercentBarChartItem(QBarSeries *series, QChart *parent = 0); | |
18 |
|
16 | |||
19 | private: |
|
17 | private: | |
20 |
|
18 | |||
21 | // From BarPresenterBase |
|
|||
22 | void layoutChanged(); // layout has changed -> need to recalculate bar sizes |
|
19 | void layoutChanged(); // layout has changed -> need to recalculate bar sizes | |
23 |
|
20 | |||
24 | private: |
|
21 | private: | |
|
22 | ||||
25 | // Data |
|
23 | // Data | |
26 | }; |
|
24 | }; | |
27 |
|
25 | |||
28 | QTCOMMERCIALCHART_END_NAMESPACE |
|
26 | QTCOMMERCIALCHART_END_NAMESPACE | |
29 |
|
27 | |||
30 |
#endif // |
|
28 | #endif // PERCENTBARCHARTITEM_H |
@@ -1,4 +1,4 | |||||
1 |
#include "stackedbar |
|
1 | #include "stackedbarchartitem_p.h" | |
2 | #include "bar_p.h" |
|
2 | #include "bar_p.h" | |
3 | #include "barvalue_p.h" |
|
3 | #include "barvalue_p.h" | |
4 | #include "qbarset.h" |
|
4 | #include "qbarset.h" | |
@@ -6,17 +6,17 | |||||
6 |
|
6 | |||
7 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
7 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
8 |
|
8 | |||
9 |
StackedBar |
|
9 | StackedBarChartItem::StackedBarChartItem(QBarSeries *series, QChart *parent) : | |
10 |
Bar |
|
10 | BarChartItem(series,parent) | |
11 | { |
|
11 | { | |
12 | } |
|
12 | } | |
13 |
|
13 | |||
14 |
StackedBar |
|
14 | StackedBarChartItem::~StackedBarChartItem() | |
15 | { |
|
15 | { | |
16 | } |
|
16 | } | |
17 |
|
17 | |||
18 |
|
18 | |||
19 |
void StackedBar |
|
19 | void StackedBarChartItem::layoutChanged() | |
20 | { |
|
20 | { | |
21 | // Scale bars to new layout |
|
21 | // Scale bars to new layout | |
22 | // Layout for bars: |
|
22 | // Layout for bars: | |
@@ -33,7 +33,7 void StackedBarPresenter::layoutChanged() | |||||
33 | } |
|
33 | } | |
34 |
|
34 | |||
35 | if (childItems().count() == 0) { |
|
35 | if (childItems().count() == 0) { | |
36 |
qDebug() << "WARNING: StackedBar |
|
36 | qDebug() << "WARNING: StackedBarChartItem::layoutChanged called before graphics items are created!"; | |
37 | return; |
|
37 | return; | |
38 | } |
|
38 | } | |
39 |
|
39 | |||
@@ -92,6 +92,6 void StackedBarPresenter::layoutChanged() | |||||
92 | } |
|
92 | } | |
93 | } |
|
93 | } | |
94 |
|
94 | |||
95 |
#include "moc_stackedbar |
|
95 | #include "moc_stackedbarchartitem_p.cpp" | |
96 |
|
96 | |||
97 | QTCOMMERCIALCHART_END_NAMESPACE |
|
97 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,21 +1,21 | |||||
1 |
#ifndef STACKEDBAR |
|
1 | #ifndef STACKEDBARCHARTITEM_H | |
2 |
#define STACKEDBAR |
|
2 | #define STACKEDBARCHARTITEM_H | |
3 |
|
3 | |||
4 |
#include "bar |
|
4 | #include "barchartitem_p.h" | |
5 | #include "qstackedbarseries.h" |
|
5 | #include "qstackedbarseries.h" | |
6 | #include <QGraphicsItem> |
|
6 | #include <QGraphicsItem> | |
7 |
|
7 | |||
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
9 |
|
9 | |||
10 |
class StackedBar |
|
10 | class StackedBarChartItem : public BarChartItem | |
11 | { |
|
11 | { | |
12 | Q_OBJECT |
|
12 | Q_OBJECT | |
13 | public: |
|
13 | public: | |
14 |
StackedBar |
|
14 | StackedBarChartItem(QBarSeries *series, QChart *parent = 0); | |
15 |
~StackedBar |
|
15 | ~StackedBarChartItem(); | |
16 |
|
16 | |||
17 | private: |
|
17 | private: | |
18 |
// From Bar |
|
18 | // From BarChartItem | |
19 | void layoutChanged(); // layout has changed -> need to recalculate bar sizes |
|
19 | void layoutChanged(); // layout has changed -> need to recalculate bar sizes | |
20 |
|
20 | |||
21 | private: |
|
21 | private: | |
@@ -25,4 +25,4 private: | |||||
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_END_NAMESPACE |
|
26 | QTCOMMERCIALCHART_END_NAMESPACE | |
27 |
|
27 | |||
28 |
#endif // STACKEDBAR |
|
28 | #endif // STACKEDBARCHARTITEM_H |
@@ -16,9 +16,9 | |||||
16 | //items |
|
16 | //items | |
17 | #include "axisitem_p.h" |
|
17 | #include "axisitem_p.h" | |
18 | #include "areachartitem_p.h" |
|
18 | #include "areachartitem_p.h" | |
19 |
#include "bar |
|
19 | #include "barchartitem_p.h" | |
20 |
#include "stackedbar |
|
20 | #include "stackedbarchartitem_p.h" | |
21 |
#include "percentbar |
|
21 | #include "percentbarchartitem_p.h" | |
22 | #include "linechartitem_p.h" |
|
22 | #include "linechartitem_p.h" | |
23 | #include "piechartitem_p.h" |
|
23 | #include "piechartitem_p.h" | |
24 | #include "scatterchartitem_p.h" |
|
24 | #include "scatterchartitem_p.h" | |
@@ -160,7 +160,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||||
160 |
|
160 | |||
161 | case QSeries::SeriesTypeBar: { |
|
161 | case QSeries::SeriesTypeBar: { | |
162 | QBarSeries* barSeries = static_cast<QBarSeries*>(series); |
|
162 | QBarSeries* barSeries = static_cast<QBarSeries*>(series); | |
163 |
Bar |
|
163 | BarChartItem* bar = new BarChartItem(barSeries,m_chart); | |
164 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
164 | if(m_options.testFlag(QChart::SeriesAnimations)) { | |
165 | // m_animator->addAnimation(bar); |
|
165 | // m_animator->addAnimation(bar); | |
166 | } |
|
166 | } | |
@@ -173,7 +173,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||||
173 |
|
173 | |||
174 | case QSeries::SeriesTypeStackedBar: { |
|
174 | case QSeries::SeriesTypeStackedBar: { | |
175 | QStackedBarSeries* stackedBarSeries = static_cast<QStackedBarSeries*>(series); |
|
175 | QStackedBarSeries* stackedBarSeries = static_cast<QStackedBarSeries*>(series); | |
176 |
StackedBar |
|
176 | StackedBarChartItem* bar = new StackedBarChartItem(stackedBarSeries,m_chart); | |
177 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
177 | if(m_options.testFlag(QChart::SeriesAnimations)) { | |
178 | // m_animator->addAnimation(bar); |
|
178 | // m_animator->addAnimation(bar); | |
179 | } |
|
179 | } | |
@@ -186,7 +186,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||||
186 |
|
186 | |||
187 | case QSeries::SeriesTypePercentBar: { |
|
187 | case QSeries::SeriesTypePercentBar: { | |
188 | QPercentBarSeries* percentBarSeries = static_cast<QPercentBarSeries*>(series); |
|
188 | QPercentBarSeries* percentBarSeries = static_cast<QPercentBarSeries*>(series); | |
189 |
PercentBar |
|
189 | PercentBarChartItem* bar = new PercentBarChartItem(percentBarSeries,m_chart); | |
190 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
190 | if(m_options.testFlag(QChart::SeriesAnimations)) { | |
191 | // m_animator->addAnimation(bar); |
|
191 | // m_animator->addAnimation(bar); | |
192 | } |
|
192 | } |
@@ -19,9 +19,9 | |||||
19 |
|
19 | |||
20 | //items |
|
20 | //items | |
21 | #include "axisitem_p.h" |
|
21 | #include "axisitem_p.h" | |
22 |
#include "bar |
|
22 | #include "barchartitem_p.h" | |
23 |
#include "stackedbar |
|
23 | #include "stackedbarchartitem_p.h" | |
24 |
#include "percentbar |
|
24 | #include "percentbarchartitem_p.h" | |
25 | #include "linechartitem_p.h" |
|
25 | #include "linechartitem_p.h" | |
26 | #include "areachartitem_p.h" |
|
26 | #include "areachartitem_p.h" | |
27 | #include "scatterchartitem_p.h" |
|
27 | #include "scatterchartitem_p.h" |
@@ -12,12 +12,12 class ChartItem; | |||||
12 | class QSeries; |
|
12 | class QSeries; | |
13 | class LineChartItem; |
|
13 | class LineChartItem; | |
14 | class QLineSeries; |
|
14 | class QLineSeries; | |
15 |
class Bar |
|
15 | class BarChartItem; | |
16 | class QBarSeries; |
|
16 | class QBarSeries; | |
17 |
class StackedBar |
|
17 | class StackedBarChartItem; | |
18 | class QStackedBarSeries; |
|
18 | class QStackedBarSeries; | |
19 | class QPercentBarSeries; |
|
19 | class QPercentBarSeries; | |
20 |
class PercentBar |
|
20 | class PercentBarChartItem; | |
21 | class QScatterSeries; |
|
21 | class QScatterSeries; | |
22 | class ScatterChartItem; |
|
22 | class ScatterChartItem; | |
23 | class PieChartItem; |
|
23 | class PieChartItem; |
@@ -14,7 +14,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
14 | class AxisItem; |
|
14 | class AxisItem; | |
15 | class QSeries; |
|
15 | class QSeries; | |
16 | class PlotDomain; |
|
16 | class PlotDomain; | |
17 |
class Bar |
|
17 | class BarChartItem; | |
18 | class QChartAxis; |
|
18 | class QChartAxis; | |
19 | class ChartTheme; |
|
19 | class ChartTheme; | |
20 | class ChartItem; |
|
20 | class ChartItem; |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now