@@ -4,7 +4,6 DEPENDPATH += $$PWD | |||
|
4 | 4 | SOURCES += \ |
|
5 | 5 | $$PWD/bar.cpp \ |
|
6 | 6 | $$PWD/barchartmodel.cpp \ |
|
7 | $$PWD/barlabel.cpp \ | |
|
8 | 7 | $$PWD/barpresenter.cpp \ |
|
9 | 8 | $$PWD/barpresenterbase.cpp \ |
|
10 | 9 | $$PWD/percentbarpresenter.cpp \ |
@@ -19,7 +18,6 SOURCES += \ | |||
|
19 | 18 | PRIVATE_HEADERS += \ |
|
20 | 19 | $$PWD/bar_p.h \ |
|
21 | 20 | $$PWD/barchartmodel_p.h \ |
|
22 | $$PWD/barlabel_p.h \ | |
|
23 | 21 | $$PWD/barpresenter_p.h \ |
|
24 | 22 | $$PWD/barpresenterbase_p.h \ |
|
25 | 23 | $$PWD/percentbarpresenter_p.h \ |
@@ -39,8 +39,6 void BarPresenter::layoutChanged() | |||
|
39 | 39 | qreal xStepPerCategory = (tW/tC) + mBarWidth; |
|
40 | 40 | |
|
41 | 41 | int itemIndex(0); |
|
42 | int labelIndex(0); | |
|
43 | ||
|
44 | 42 | for (int category=0; category < categoryCount; category++) { |
|
45 | 43 | qreal xPos = xStepPerCategory * category; |
|
46 | 44 | qreal yPos = mHeight; |
@@ -55,12 +53,6 void BarPresenter::layoutChanged() | |||
|
55 | 53 | itemIndex++; |
|
56 | 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 | 58 | // Position floating values |
@@ -55,7 +55,6 void BarPresenterBase::dataChanged() | |||
|
55 | 55 | } |
|
56 | 56 | |
|
57 | 57 | mBars.clear(); |
|
58 | mLabels.clear(); | |
|
59 | 58 | mSeparators.clear(); |
|
60 | 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 | 76 | // Create separators |
|
89 | 77 | int count = mSeries->categoryCount() - 1; // There is one less separator than columns |
|
90 | 78 | for (int i=0; i<count; i++) { |
@@ -10,7 +10,6 | |||
|
10 | 10 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
11 | 11 | |
|
12 | 12 | class Bar; |
|
13 | class BarLabel; | |
|
14 | 13 | class Separator; |
|
15 | 14 | class BarValue; |
|
16 | 15 | class QChartAxisCategories; |
@@ -59,7 +58,6 protected: | |||
|
59 | 58 | // Not owned. |
|
60 | 59 | QBarSeries* mSeries; |
|
61 | 60 | QList<Bar*> mBars; |
|
62 | QList<BarLabel*> mLabels; | |
|
63 | 61 | QList<Separator*> mSeparators; |
|
64 | 62 | QList<BarValue*> mFloatingValues; |
|
65 | 63 | QChart* mChart; |
@@ -39,7 +39,6 void PercentBarPresenter::layoutChanged() | |||
|
39 | 39 | qreal h = mHeight; |
|
40 | 40 | |
|
41 | 41 | int itemIndex(0); |
|
42 | int labelIndex(0); | |
|
43 | 42 | for (int category = 0; category < mSeries->categoryCount(); category++) { |
|
44 | 43 | qreal colSum = mSeries->categorySum(category); |
|
45 | 44 | qreal scale = (h / colSum); |
@@ -55,11 +54,6 void PercentBarPresenter::layoutChanged() | |||
|
55 | 54 | itemIndex++; |
|
56 | 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 | 57 | xPos += xStep; |
|
64 | 58 | } |
|
65 | 59 |
@@ -51,7 +51,6 void StackedBarPresenter::layoutChanged() | |||
|
51 | 51 | qreal xPos = ((tW/tC) - mBarWidth / 2); |
|
52 | 52 | |
|
53 | 53 | int itemIndex(0); |
|
54 | int labelIndex(0); | |
|
55 | 54 | for (int category = 0; category < mSeries->categoryCount(); category++) { |
|
56 | 55 | qreal yPos = h; |
|
57 | 56 | for (int set=0; set < mSeries->barsetCount(); set++) { |
@@ -64,11 +63,6 void StackedBarPresenter::layoutChanged() | |||
|
64 | 63 | itemIndex++; |
|
65 | 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 | 66 | xPos += xStep; |
|
73 | 67 | } |
|
74 | 68 |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now