@@ -4,7 +4,6 DEPENDPATH += $$PWD | |||||
4 | SOURCES += \ |
|
4 | SOURCES += \ | |
5 | $$PWD/bar.cpp \ |
|
5 | $$PWD/bar.cpp \ | |
6 | $$PWD/barchartmodel.cpp \ |
|
6 | $$PWD/barchartmodel.cpp \ | |
7 | $$PWD/barlabel.cpp \ |
|
|||
8 | $$PWD/barpresenter.cpp \ |
|
7 | $$PWD/barpresenter.cpp \ | |
9 | $$PWD/barpresenterbase.cpp \ |
|
8 | $$PWD/barpresenterbase.cpp \ | |
10 | $$PWD/percentbarpresenter.cpp \ |
|
9 | $$PWD/percentbarpresenter.cpp \ | |
@@ -19,7 +18,6 SOURCES += \ | |||||
19 | PRIVATE_HEADERS += \ |
|
18 | PRIVATE_HEADERS += \ | |
20 | $$PWD/bar_p.h \ |
|
19 | $$PWD/bar_p.h \ | |
21 | $$PWD/barchartmodel_p.h \ |
|
20 | $$PWD/barchartmodel_p.h \ | |
22 | $$PWD/barlabel_p.h \ |
|
|||
23 | $$PWD/barpresenter_p.h \ |
|
21 | $$PWD/barpresenter_p.h \ | |
24 | $$PWD/barpresenterbase_p.h \ |
|
22 | $$PWD/barpresenterbase_p.h \ | |
25 | $$PWD/percentbarpresenter_p.h \ |
|
23 | $$PWD/percentbarpresenter_p.h \ |
@@ -39,8 +39,6 void BarPresenter::layoutChanged() | |||||
39 | qreal xStepPerCategory = (tW/tC) + mBarWidth; |
|
39 | qreal xStepPerCategory = (tW/tC) + mBarWidth; | |
40 |
|
40 | |||
41 | int itemIndex(0); |
|
41 | int itemIndex(0); | |
42 | int labelIndex(0); |
|
|||
43 |
|
||||
44 | for (int category=0; category < categoryCount; category++) { |
|
42 | for (int category=0; category < categoryCount; category++) { | |
45 | qreal xPos = xStepPerCategory * category; |
|
43 | qreal xPos = xStepPerCategory * category; | |
46 | qreal yPos = mHeight; |
|
44 | qreal yPos = mHeight; | |
@@ -55,12 +53,6 void BarPresenter::layoutChanged() | |||||
55 | itemIndex++; |
|
53 | itemIndex++; | |
56 | xPos += mBarWidth; |
|
54 | xPos += mBarWidth; | |
57 | } |
|
55 | } | |
58 |
|
||||
59 | // TODO: Layout for labels, remove magic number |
|
|||
60 | xPos = xStepPerCategory * category + mBarWidth/2; |
|
|||
61 | BarLabel* label = mLabels.at(labelIndex); |
|
|||
62 | label->setPos(xPos, mHeight - 20); |
|
|||
63 | labelIndex++; |
|
|||
64 | } |
|
56 | } | |
65 |
|
57 | |||
66 | // Position floating values |
|
58 | // Position floating values |
@@ -55,7 +55,6 void BarPresenterBase::dataChanged() | |||||
55 | } |
|
55 | } | |
56 |
|
56 | |||
57 | mBars.clear(); |
|
57 | mBars.clear(); | |
58 | mLabels.clear(); |
|
|||
59 | mSeparators.clear(); |
|
58 | mSeparators.clear(); | |
60 | mFloatingValues.clear(); |
|
59 | mFloatingValues.clear(); | |
61 |
|
60 | |||
@@ -74,17 +73,6 void BarPresenterBase::dataChanged() | |||||
74 | } |
|
73 | } | |
75 | } |
|
74 | } | |
76 |
|
75 | |||
77 | // Create labels |
|
|||
78 | /* |
|
|||
79 | int count = mSeries->categoryCount(); |
|
|||
80 | for (int i=0; i<count; i++) { |
|
|||
81 | BarLabel* label = new BarLabel(this); |
|
|||
82 | label->set(mSeries->categoryName(i)); |
|
|||
83 | childItems().append(label); |
|
|||
84 | mLabels.append(label); |
|
|||
85 | } |
|
|||
86 | */ |
|
|||
87 |
|
||||
88 | // Create separators |
|
76 | // Create separators | |
89 | int count = mSeries->categoryCount() - 1; // There is one less separator than columns |
|
77 | int count = mSeries->categoryCount() - 1; // There is one less separator than columns | |
90 | for (int i=0; i<count; i++) { |
|
78 | for (int i=0; i<count; i++) { |
@@ -10,7 +10,6 | |||||
10 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
10 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
11 |
|
11 | |||
12 | class Bar; |
|
12 | class Bar; | |
13 | class BarLabel; |
|
|||
14 | class Separator; |
|
13 | class Separator; | |
15 | class BarValue; |
|
14 | class BarValue; | |
16 | class QChartAxisCategories; |
|
15 | class QChartAxisCategories; | |
@@ -59,7 +58,6 protected: | |||||
59 | // Not owned. |
|
58 | // Not owned. | |
60 | QBarSeries* mSeries; |
|
59 | QBarSeries* mSeries; | |
61 | QList<Bar*> mBars; |
|
60 | QList<Bar*> mBars; | |
62 | QList<BarLabel*> mLabels; |
|
|||
63 | QList<Separator*> mSeparators; |
|
61 | QList<Separator*> mSeparators; | |
64 | QList<BarValue*> mFloatingValues; |
|
62 | QList<BarValue*> mFloatingValues; | |
65 | QChart* mChart; |
|
63 | QChart* mChart; |
@@ -39,7 +39,6 void PercentBarPresenter::layoutChanged() | |||||
39 | qreal h = mHeight; |
|
39 | qreal h = mHeight; | |
40 |
|
40 | |||
41 | int itemIndex(0); |
|
41 | int itemIndex(0); | |
42 | int labelIndex(0); |
|
|||
43 | for (int category = 0; category < mSeries->categoryCount(); category++) { |
|
42 | for (int category = 0; category < mSeries->categoryCount(); category++) { | |
44 | qreal colSum = mSeries->categorySum(category); |
|
43 | qreal colSum = mSeries->categorySum(category); | |
45 | qreal scale = (h / colSum); |
|
44 | qreal scale = (h / colSum); | |
@@ -55,11 +54,6 void PercentBarPresenter::layoutChanged() | |||||
55 | itemIndex++; |
|
54 | itemIndex++; | |
56 | yPos -= barHeight; |
|
55 | yPos -= barHeight; | |
57 | } |
|
56 | } | |
58 |
|
||||
59 | // TODO: Layout for labels, remove magic number |
|
|||
60 | BarLabel* label = mLabels.at(labelIndex); |
|
|||
61 | label->setPos(xPos, mHeight + 20); |
|
|||
62 | labelIndex++; |
|
|||
63 | xPos += xStep; |
|
57 | xPos += xStep; | |
64 | } |
|
58 | } | |
65 |
|
59 |
@@ -51,7 +51,6 void StackedBarPresenter::layoutChanged() | |||||
51 | qreal xPos = ((tW/tC) - mBarWidth / 2); |
|
51 | qreal xPos = ((tW/tC) - mBarWidth / 2); | |
52 |
|
52 | |||
53 | int itemIndex(0); |
|
53 | int itemIndex(0); | |
54 | int labelIndex(0); |
|
|||
55 | for (int category = 0; category < mSeries->categoryCount(); category++) { |
|
54 | for (int category = 0; category < mSeries->categoryCount(); category++) { | |
56 | qreal yPos = h; |
|
55 | qreal yPos = h; | |
57 | for (int set=0; set < mSeries->barsetCount(); set++) { |
|
56 | for (int set=0; set < mSeries->barsetCount(); set++) { | |
@@ -64,11 +63,6 void StackedBarPresenter::layoutChanged() | |||||
64 | itemIndex++; |
|
63 | itemIndex++; | |
65 | yPos -= barHeight; |
|
64 | yPos -= barHeight; | |
66 | } |
|
65 | } | |
67 |
|
||||
68 | // TODO: Layout for labels, remove magic number |
|
|||
69 | // BarLabel* label = mLabels.at(labelIndex); |
|
|||
70 | // label->setPos(xPos, mHeight + 20); |
|
|||
71 | labelIndex++; |
|
|||
72 | xPos += xStep; |
|
66 | xPos += xStep; | |
73 | } |
|
67 | } | |
74 |
|
68 |
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