##// END OF EJS Templates
Fixed qmlcustommodel
Marek Rosa -
r1619:184fe7965456
parent child
Show More
@@ -34,7 +34,13 Rectangle {
34 34
35 35 BarCategoriesAxis {
36 36 id: categoryAxis
37 categories: ["2007", "2008", "2009", "2010", "2011", "2012" ]
37 categories: ["2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014" ]
38 }
39
40 ValuesAxis {
41 id: yAxis
42 min: 0
43 max: 60
38 44 }
39 45 // ...
40 46 //![1]
@@ -58,7 +64,7 Rectangle {
58 64 id: myBarSeries
59 65 name: "Others"
60 66 barWidth: 0.9
61 // visible: false
67 visible: false
62 68 HBarModelMapper {
63 69 model: customModel
64 70 firstBarSetRow: 6
@@ -70,8 +76,9 Rectangle {
70 76
71 77 //![4]
72 78 LineSeries {
79 id: lineSeries1
73 80 name: "Volkswagen"
74 //visible: false
81 visible: false
75 82 HXYModelMapper {
76 83 model: customModel
77 84 xRow: 0
@@ -82,6 +89,7 Rectangle {
82 89 //![4]
83 90
84 91 LineSeries {
92 id: lineSeries2
85 93 name: "Toyota"
86 94 visible: false
87 95 HXYModelMapper {
@@ -93,6 +101,7 Rectangle {
93 101 }
94 102
95 103 LineSeries {
104 id: lineSeries3
96 105 name: "Ford"
97 106 visible: false
98 107 HXYModelMapper {
@@ -104,6 +113,7 Rectangle {
104 113 }
105 114
106 115 LineSeries {
116 id: lineSeries4
107 117 name: "Skoda"
108 118 visible: false
109 119 HXYModelMapper {
@@ -115,6 +125,7 Rectangle {
115 125 }
116 126
117 127 LineSeries {
128 id: lineSeries5
118 129 name: "Volvo"
119 130 visible: false
120 131 HXYModelMapper {
@@ -129,7 +140,7 Rectangle {
129 140 PieSeries {
130 141 id: pieSeries
131 142 size: 0.4
132 horizontalPosition: 0.7
143 horizontalPosition: 0.85
133 144 verticalPosition: 0.4
134 145 onClicked: {
135 146 // Show the selection by exploding the slice
@@ -142,20 +153,32 Rectangle {
142 153 }
143 154 }
144 155 }
145 }
146 //![3]
147 156
148 157 VPieModelMapper {
149 series: pieSeries
150 158 model: customModel
151 159 labelsColumn: 1
152 160 valuesColumn: 2
153 161 firstRow: 1
154 162 }
163 }
164 //![3]
155 165
156 166 Component.onCompleted: {
157 167 createDefaultAxes();
158 168 setAxisX(categoryAxis,myBarSeries)
169 setAxisX(categoryAxis,lineSeries1)
170 setAxisX(categoryAxis,lineSeries2)
171 setAxisX(categoryAxis,lineSeries3)
172 setAxisX(categoryAxis,lineSeries4)
173 setAxisX(categoryAxis,lineSeries5)
174 setAxisY(yAxis,myBarSeries)
175 setAxisY(yAxis,lineSeries1)
176 setAxisY(yAxis,lineSeries2)
177 setAxisY(yAxis,lineSeries3)
178 setAxisY(yAxis,lineSeries4)
179 setAxisY(yAxis,lineSeries5)
180 categoryAxis.min = "2007"
181 categoryAxis.max = "2014"
159 182 }
160 183 }
161 184 }
General Comments 0
You need to be logged in to leave comments. Login now