@@ -29,11 +29,9 Rectangle { | |||
|
29 | 29 | anchors.fill: parent |
|
30 | 30 | theme: ChartView.ChartThemeLight |
|
31 | 31 | legend: ChartView.LegendBottom |
|
32 | // TODO: labels defined by x-axis, not by bar series | |
|
33 | axisXLabels: ["0", "2008", "1", "2009", "2", "2010", "3", "2012"] | |
|
32 | axisXLabels: ["0", "2007", "1", "2008", "2", "2009", "3", "2010", "4", "2011", "5", "2012"] | |
|
34 | 33 | |
|
35 | 34 | GroupedBarSeries { |
|
36 | barCategories: [ "2008", "2009", "2010", "2011", "2012" ] | |
|
37 | 35 | BarSet { name: "Bob"; values: [2, 2, 3, 4, 5, 6] } |
|
38 | 36 | BarSet { name: "Susan"; values: [5, 1, 2, 4, 1, 7] } |
|
39 | 37 | BarSet { name: "James"; values: [3, 5, 8, 13, 5, 8] } |
@@ -96,7 +96,6 Rectangle { | |||
|
96 | 96 | |
|
97 | 97 | GroupedBarSeries { |
|
98 | 98 | name: "Skoda and Volvo" |
|
99 | barCategories: [ "1", "2", "3", "4", "5", "6" ] | |
|
100 | 99 | HBarModelMapper { |
|
101 | 100 | model: customModel |
|
102 | 101 | firstBarSetRow: 4 |
@@ -35,11 +35,10 Rectangle { | |||
|
35 | 35 | anchors.left: parent.left |
|
36 | 36 | anchors.right: parent.right |
|
37 | 37 | legend: ChartView.LegendTop |
|
38 | axisXLabels: ["0", "Mo", "1", "Tu", "2", "We", "3", "Th", "4", "Fr", "5", "Sa"] | |
|
38 | 39 | |
|
39 | 40 | //![2] |
|
40 |
|
|
|
41 | GroupedBarSeries { | |
|
42 | barCategories: [ "2008", "2009", "2010", "2011", "2012" ] | |
|
41 | BarSeries { | |
|
43 | 42 | BarSet { |
|
44 | 43 | id: rainfallSet |
|
45 | 44 | name: "Rainfall" |
@@ -122,16 +122,6 void DeclarativeBarSeries::appendSeriesChildren(QDeclarativeListProperty<QObject | |||
|
122 | 122 | Q_UNUSED(element); |
|
123 | 123 | } |
|
124 | 124 | |
|
125 | void DeclarativeBarSeries::setBarCategories(QStringList categories) | |
|
126 | { | |
|
127 | setCategories(categories); | |
|
128 | } | |
|
129 | ||
|
130 | QStringList DeclarativeBarSeries::barCategories() | |
|
131 | { | |
|
132 | return categories(); | |
|
133 | } | |
|
134 | ||
|
135 | 125 | DeclarativeBarSet *DeclarativeBarSeries::at(int index) |
|
136 | 126 | { |
|
137 | 127 | QList<QBarSet*> setList = barSets(); |
@@ -177,16 +167,6 void DeclarativeGroupedBarSeries::appendSeriesChildren(QDeclarativeListProperty< | |||
|
177 | 167 | Q_UNUSED(element); |
|
178 | 168 | } |
|
179 | 169 | |
|
180 | void DeclarativeGroupedBarSeries::setBarCategories(QStringList categories) | |
|
181 | { | |
|
182 | setCategories(categories); | |
|
183 | } | |
|
184 | ||
|
185 | QStringList DeclarativeGroupedBarSeries::barCategories() | |
|
186 | { | |
|
187 | return categories(); | |
|
188 | } | |
|
189 | ||
|
190 | 170 | DeclarativeBarSet *DeclarativeGroupedBarSeries::at(int index) |
|
191 | 171 | { |
|
192 | 172 | QList<QBarSet*> setList = barSets(); |
@@ -61,17 +61,12 class DeclarativeBarSeries : public QBarSeries, public QDeclarativeParserStatus | |||
|
61 | 61 | { |
|
62 | 62 | Q_OBJECT |
|
63 | 63 | Q_INTERFACES(QDeclarativeParserStatus) |
|
64 | Q_PROPERTY(QStringList barCategories READ barCategories WRITE setBarCategories) | |
|
65 | 64 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
66 | 65 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
67 | 66 | |
|
68 | 67 | public: |
|
69 | 68 | explicit DeclarativeBarSeries(QDeclarativeItem *parent = 0); |
|
70 | 69 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
71 | ||
|
72 | void setBarCategories(QStringList categories); | |
|
73 | QStringList barCategories(); | |
|
74 | ||
|
75 | 70 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
76 | 71 | |
|
77 | 72 | public: // from QDeclarativeParserStatus |
@@ -86,17 +81,12 class DeclarativeGroupedBarSeries : public QGroupedBarSeries, public QDeclarativ | |||
|
86 | 81 | { |
|
87 | 82 | Q_OBJECT |
|
88 | 83 | Q_INTERFACES(QDeclarativeParserStatus) |
|
89 | Q_PROPERTY(QStringList barCategories READ barCategories WRITE setBarCategories) | |
|
90 | 84 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
91 | 85 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
92 | 86 | |
|
93 | 87 | public: |
|
94 | 88 | explicit DeclarativeGroupedBarSeries(QDeclarativeItem *parent = 0); |
|
95 | 89 | QDeclarativeListProperty<QObject> seriesChildren(); |
|
96 | ||
|
97 | void setBarCategories(QStringList categories); | |
|
98 | QStringList barCategories(); | |
|
99 | ||
|
100 | 90 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
101 | 91 | |
|
102 | 92 | public: // from QDeclarativeParserStatus |
@@ -26,16 +26,14 ChartView { | |||
|
26 | 26 | anchors.fill: parent |
|
27 | 27 | theme: ChartView.ChartThemeLight |
|
28 | 28 | legend: ChartView.LegendBottom |
|
29 | // TODO: labels defined by x-axis, not by bar series | |
|
30 | axisXLabels: ["0", "2008", "1", "2009", "2", "2010", "3", "2012"] | |
|
29 | axisXLabels: ["0", "2007", "1", "2008", "2", "2009", "3", "2010", "4", "2011", "5", "2012"] | |
|
31 | 30 | |
|
32 | 31 | property variant series: daSeries |
|
33 | 32 | |
|
34 | 33 | BarSeries { |
|
35 | 34 | id: daSeries |
|
36 | barCategories: [ "2008", "2009", "2010", "2011", "2012" ] | |
|
37 |
BarSet { name: " |
|
|
38 |
BarSet { name: " |
|
|
39 | BarSet { name: "James"; values: [3, 5, 8, 13, 5, 8] } | |
|
35 | BarSet { name: "Bob"; values: [4, 7, 3, 10, 5, 6] } | |
|
36 | BarSet { name: "Susan"; values: [5, 1, 2, 4, 1, 8] } | |
|
37 | BarSet { name: "James"; values: [3, 5, 8, 5, 4, 7] } | |
|
40 | 38 | } |
|
41 | 39 | } |
@@ -26,14 +26,12 ChartView { | |||
|
26 | 26 | anchors.fill: parent |
|
27 | 27 | theme: ChartView.ChartThemeLight |
|
28 | 28 | legend: ChartView.LegendBottom |
|
29 | // TODO: labels defined by x-axis, not by bar series | |
|
30 | axisXLabels: ["0", "2008", "1", "2009", "2", "2010", "3", "2012"] | |
|
29 | axisXLabels: ["0", "2007", "1", "2008", "2", "2009", "3", "2010", "4", "2011", "5", "2012"] | |
|
31 | 30 | |
|
32 | 31 | property variant series: daSeries |
|
33 | 32 | |
|
34 | 33 | GroupedBarSeries { |
|
35 | 34 | id: daSeries |
|
36 | barCategories: [ "2008", "2009", "2010", "2011", "2012" ] | |
|
37 | 35 | BarSet { name: "Bob"; values: [2, 2, 3, 4, 5, 6] } |
|
38 | 36 | BarSet { name: "Susan"; values: [5, 1, 2, 4, 1, 7] } |
|
39 | 37 | BarSet { name: "James"; values: [3, 5, 8, 13, 5, 8] } |
@@ -26,8 +26,7 ChartView { | |||
|
26 | 26 | anchors.fill: parent |
|
27 | 27 | theme: ChartView.ChartThemeLight |
|
28 | 28 | legend: ChartView.LegendBottom |
|
29 | // TODO: labels defined by x-axis, not by bar series | |
|
30 | axisXLabels: ["0", "2008", "1", "2009", "2", "2010", "3", "2012"] | |
|
29 | axisXLabels: ["0", "2007", "1", "2008", "2", "2009", "3", "2010", "4", "2011", "5", "2012"] | |
|
31 | 30 | |
|
32 | 31 | property variant series: daSeries |
|
33 | 32 |
@@ -26,7 +26,7 ChartView { | |||
|
26 | 26 | anchors.fill: parent |
|
27 | 27 | theme: ChartView.ChartThemeLight |
|
28 | 28 | legend: ChartView.LegendBottom |
|
29 |
axisXLabels: ["0", "200 |
|
|
29 | axisXLabels: ["0", "2007", "1", "2008", "2", "2009", "3", "2010", "4", "2011", "5", "2012"] | |
|
30 | 30 | |
|
31 | 31 | property variant series: daSeries |
|
32 | 32 |
General Comments 0
You need to be logged in to leave comments.
Login now