##// END OF EJS Templates
qmlchartproperties: font buttons for chart and pie
Jani Honkonen -
r1518:b1f54692a9e3
parent child
Show More
@@ -1,255 +1,263
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.0
23
23
24
24
25 Flow {
25 Flow {
26 id: flow
26 id: flow
27 spacing: 5
27 spacing: 5
28 flow: Flow.TopToBottom
28 flow: Flow.TopToBottom
29 property variant series // TODO: rename to chart
29 property variant series // TODO: rename to chart
30
30
31 Button {
31 Button {
32 text: "visible"
32 text: "visible"
33 onClicked: series.visible = !series.visible;
33 onClicked: series.visible = !series.visible;
34 }
34 }
35 Button {
35 Button {
36 text: "theme +"
36 text: "theme +"
37 onClicked: series.theme++;
37 onClicked: series.theme++;
38 }
38 }
39 Button {
39 Button {
40 text: "theme -"
40 text: "theme -"
41 onClicked: series.theme--;
41 onClicked: series.theme--;
42 }
42 }
43 Button {
43 Button {
44 text: "animation opt +"
44 text: "animation opt +"
45 onClicked: series.animationOptions++;
45 onClicked: series.animationOptions++;
46 }
46 }
47 Button {
47 Button {
48 text: "animation opt -"
48 text: "animation opt -"
49 onClicked: series.animationOptions--;
49 onClicked: series.animationOptions--;
50 }
50 }
51 Button {
51 Button {
52 text: "title font bold"
53 onClicked: series.titleFont.bold = !series.titleFont.bold;
54 }
55 Button {
52 text: "title color"
56 text: "title color"
53 onClicked: series.titleColor = main.nextColor();
57 onClicked: series.titleColor = main.nextColor();
54 }
58 }
55 Button {
59 Button {
56 text: "background color"
60 text: "background color"
57 onClicked: series.backgroundColor = main.nextColor();
61 onClicked: series.backgroundColor = main.nextColor();
58 }
62 }
59 Button {
63 Button {
60 text: "drop shadow enabled"
64 text: "drop shadow enabled"
61 onClicked: series.dropShadowEnabled = !series.dropShadowEnabled;
65 onClicked: series.dropShadowEnabled = !series.dropShadowEnabled;
62 }
66 }
63 Button {
67 Button {
64 text: "zoom +"
68 text: "zoom +"
65 onClicked: series.zoom(2);
69 onClicked: series.zoom(2);
66 }
70 }
67 Button {
71 Button {
68 text: "zoom -"
72 text: "zoom -"
69 onClicked: series.zoom(0.5);
73 onClicked: series.zoom(0.5);
70 }
74 }
71 Button {
75 Button {
72 text: "scroll left"
76 text: "scroll left"
73 onClicked: series.scrollLeft(10);
77 onClicked: series.scrollLeft(10);
74 }
78 }
75 Button {
79 Button {
76 text: "scroll right"
80 text: "scroll right"
77 onClicked: series.scrollRight(10);
81 onClicked: series.scrollRight(10);
78 }
82 }
79 Button {
83 Button {
80 text: "scroll up"
84 text: "scroll up"
81 onClicked: series.scrollUp(10);
85 onClicked: series.scrollUp(10);
82 }
86 }
83 Button {
87 Button {
84 text: "scroll down"
88 text: "scroll down"
85 onClicked: series.scrollDown(10);
89 onClicked: series.scrollDown(10);
86 }
90 }
87 Button {
91 Button {
88 text: "legend visible"
92 text: "legend visible"
89 onClicked: series.legend.visible = !series.legend.visible;
93 onClicked: series.legend.visible = !series.legend.visible;
90 }
94 }
91 Button {
95 Button {
92 text: "legend bckgrd visible"
96 text: "legend bckgrd visible"
93 onClicked: series.legend.backgroundVisible = !series.legend.backgroundVisible;
97 onClicked: series.legend.backgroundVisible = !series.legend.backgroundVisible;
94 }
98 }
95 Button {
99 Button {
96 text: "legend color"
100 text: "legend color"
97 onClicked: series.legend.color = main.nextColor();
101 onClicked: series.legend.color = main.nextColor();
98 }
102 }
99 Button {
103 Button {
100 text: "legend border color"
104 text: "legend border color"
101 onClicked: series.legend.borderColor = main.nextColor();
105 onClicked: series.legend.borderColor = main.nextColor();
102 }
106 }
103 Button {
107 Button {
104 text: "legend top"
108 text: "legend top"
105 onClicked: series.legend.alignment ^= Qt.AlignTop;
109 onClicked: series.legend.alignment ^= Qt.AlignTop;
106 }
110 }
107 Button {
111 Button {
108 text: "legend bottom"
112 text: "legend bottom"
109 onClicked: series.legend.alignment ^= Qt.AlignBottom;
113 onClicked: series.legend.alignment ^= Qt.AlignBottom;
110 }
114 }
111 Button {
115 Button {
112 text: "legend left"
116 text: "legend left"
113 onClicked: series.legend.alignment ^= Qt.AlignLeft;
117 onClicked: series.legend.alignment ^= Qt.AlignLeft;
114 }
118 }
115 Button {
119 Button {
116 text: "legend right"
120 text: "legend right"
117 onClicked: series.legend.alignment ^= Qt.AlignRight;
121 onClicked: series.legend.alignment ^= Qt.AlignRight;
118 }
122 }
119 Button {
123 Button {
120 text: "axis X visible"
124 text: "axis X visible"
121 onClicked: series.axisX.visible = !series.axisX.visible;
125 onClicked: series.axisX.visible = !series.axisX.visible;
122 }
126 }
123 Button {
127 Button {
124 text: "axis X grid visible"
128 text: "axis X grid visible"
125 onClicked: series.axisX.gridVisible = !series.axisX.gridVisible;
129 onClicked: series.axisX.gridVisible = !series.axisX.gridVisible;
126 }
130 }
127 Button {
131 Button {
132 text: "axis X labels italic"
133 onClicked: series.axisX.labelsFont.italic = !series.axisX.labelsFont.italic;
134 }
135 Button {
128 text: "axis X labels visible"
136 text: "axis X labels visible"
129 onClicked: series.axisX.labelsVisible = !series.axisX.labelsVisible;
137 onClicked: series.axisX.labelsVisible = !series.axisX.labelsVisible;
130 }
138 }
131 Button {
139 Button {
132 text: "axis X color"
140 text: "axis X color"
133 onClicked: series.axisX.color = main.nextColor();
141 onClicked: series.axisX.color = main.nextColor();
134 }
142 }
135 Button {
143 Button {
136 text: "axis X labels color"
144 text: "axis X labels color"
137 onClicked: series.axisX.labelsColor = main.nextColor();
145 onClicked: series.axisX.labelsColor = main.nextColor();
138 }
146 }
139 Button {
147 Button {
140 text: "axis X labels angle +"
148 text: "axis X labels angle +"
141 onClicked: series.axisX.labelsAngle += 5;
149 onClicked: series.axisX.labelsAngle += 5;
142 }
150 }
143 Button {
151 Button {
144 text: "axis X labels angle -"
152 text: "axis X labels angle -"
145 onClicked: series.axisX.labelsAngle -= 5;
153 onClicked: series.axisX.labelsAngle -= 5;
146 }
154 }
147 Button {
155 Button {
148 text: "axis X shades visible"
156 text: "axis X shades visible"
149 onClicked: series.axisX.shadesVisible = !series.axisX.shadesVisible;
157 onClicked: series.axisX.shadesVisible = !series.axisX.shadesVisible;
150 }
158 }
151 Button {
159 Button {
152 text: "axis X shades color"
160 text: "axis X shades color"
153 onClicked: series.axisX.shadesColor = main.nextColor();
161 onClicked: series.axisX.shadesColor = main.nextColor();
154 }
162 }
155 Button {
163 Button {
156 text: "axis X shades bcolor"
164 text: "axis X shades bcolor"
157 onClicked: series.axisX.shadesBorderColor = main.nextColor();
165 onClicked: series.axisX.shadesBorderColor = main.nextColor();
158 }
166 }
159 Button {
167 Button {
160 text: "axis X max +"
168 text: "axis X max +"
161 onClicked: series.axisX.max += 0.1;
169 onClicked: series.axisX.max += 0.1;
162 }
170 }
163 Button {
171 Button {
164 text: "axis X max -"
172 text: "axis X max -"
165 onClicked: series.axisX.max -= 0.1;
173 onClicked: series.axisX.max -= 0.1;
166 }
174 }
167 Button {
175 Button {
168 text: "axis X min +"
176 text: "axis X min +"
169 onClicked: series.axisX.min += 0.1;
177 onClicked: series.axisX.min += 0.1;
170 }
178 }
171 Button {
179 Button {
172 text: "axis X min -"
180 text: "axis X min -"
173 onClicked: series.axisX.min -= 0.1;
181 onClicked: series.axisX.min -= 0.1;
174 }
182 }
175 Button {
183 Button {
176 text: "axis X ticks count +"
184 text: "axis X ticks count +"
177 onClicked: series.axisX.ticksCount++;
185 onClicked: series.axisX.ticksCount++;
178 }
186 }
179 Button {
187 Button {
180 text: "axis X ticks count -"
188 text: "axis X ticks count -"
181 onClicked: series.axisX.ticksCount--;
189 onClicked: series.axisX.ticksCount--;
182 }
190 }
183 Button {
191 Button {
184 text: "axis X nice nmb"
192 text: "axis X nice nmb"
185 onClicked: series.axisX.niceNumbersEnabled = !series.axisX.niceNumbersEnabled;
193 onClicked: series.axisX.niceNumbersEnabled = !series.axisX.niceNumbersEnabled;
186 }
194 }
187 Button {
195 Button {
188 text: "axis Y visible"
196 text: "axis Y visible"
189 onClicked: series.axisY.visible = !series.axisY.visible;
197 onClicked: series.axisY.visible = !series.axisY.visible;
190 }
198 }
191 Button {
199 Button {
192 text: "axis Y grid visible"
200 text: "axis Y grid visible"
193 onClicked: series.axisY.gridVisible = !series.axisY.gridVisible;
201 onClicked: series.axisY.gridVisible = !series.axisY.gridVisible;
194 }
202 }
195 Button {
203 Button {
196 text: "axis Y labels visible"
204 text: "axis Y labels visible"
197 onClicked: series.axisY.labelsVisible = !series.axisY.labelsVisible;
205 onClicked: series.axisY.labelsVisible = !series.axisY.labelsVisible;
198 }
206 }
199 Button {
207 Button {
200 text: "axis Y color"
208 text: "axis Y color"
201 onClicked: series.axisY.color = main.nextColor();
209 onClicked: series.axisY.color = main.nextColor();
202 }
210 }
203 Button {
211 Button {
204 text: "axis Y labels color"
212 text: "axis Y labels color"
205 onClicked: series.axisY.labelsColor = main.nextColor();
213 onClicked: series.axisY.labelsColor = main.nextColor();
206 }
214 }
207 Button {
215 Button {
208 text: "axis Y labels angle +"
216 text: "axis Y labels angle +"
209 onClicked: series.axisY.labelsAngle += 5;
217 onClicked: series.axisY.labelsAngle += 5;
210 }
218 }
211 Button {
219 Button {
212 text: "axis Y labels angle -"
220 text: "axis Y labels angle -"
213 onClicked: series.axisY.labelsAngle -= 5;
221 onClicked: series.axisY.labelsAngle -= 5;
214 }
222 }
215 Button {
223 Button {
216 text: "axis Y shades visible"
224 text: "axis Y shades visible"
217 onClicked: series.axisY.shadesVisible = !series.axisY.shadesVisible;
225 onClicked: series.axisY.shadesVisible = !series.axisY.shadesVisible;
218 }
226 }
219 Button {
227 Button {
220 text: "axis Y shades color"
228 text: "axis Y shades color"
221 onClicked: series.axisY.shadesColor = main.nextColor();
229 onClicked: series.axisY.shadesColor = main.nextColor();
222 }
230 }
223 Button {
231 Button {
224 text: "axis Y shades bcolor"
232 text: "axis Y shades bcolor"
225 onClicked: series.axisY.shadesBorderColor = main.nextColor();
233 onClicked: series.axisY.shadesBorderColor = main.nextColor();
226 }
234 }
227 Button {
235 Button {
228 text: "axis Y max +"
236 text: "axis Y max +"
229 onClicked: series.axisY.max += 0.1;
237 onClicked: series.axisY.max += 0.1;
230 }
238 }
231 Button {
239 Button {
232 text: "axis Y max -"
240 text: "axis Y max -"
233 onClicked: series.axisY.max -= 0.1;
241 onClicked: series.axisY.max -= 0.1;
234 }
242 }
235 Button {
243 Button {
236 text: "axis Y min +"
244 text: "axis Y min +"
237 onClicked: series.axisY.min += 0.1;
245 onClicked: series.axisY.min += 0.1;
238 }
246 }
239 Button {
247 Button {
240 text: "axis Y min -"
248 text: "axis Y min -"
241 onClicked: series.axisY.min -= 0.1;
249 onClicked: series.axisY.min -= 0.1;
242 }
250 }
243 Button {
251 Button {
244 text: "axis Y ticks count +"
252 text: "axis Y ticks count +"
245 onClicked: series.axisY.ticksCount++;
253 onClicked: series.axisY.ticksCount++;
246 }
254 }
247 Button {
255 Button {
248 text: "axis Y ticks count -"
256 text: "axis Y ticks count -"
249 onClicked: series.axisY.ticksCount--;
257 onClicked: series.axisY.ticksCount--;
250 }
258 }
251 Button {
259 Button {
252 text: "axis Y nice nmb"
260 text: "axis Y nice nmb"
253 onClicked: series.axisY.niceNumbersEnabled = !series.axisY.niceNumbersEnabled;
261 onClicked: series.axisY.niceNumbersEnabled = !series.axisY.niceNumbersEnabled;
254 }
262 }
255 }
263 }
@@ -1,130 +1,138
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.0
23
23
24 Flow {
24 Flow {
25 id: flow
25 id: flow
26 spacing: 5
26 spacing: 5
27 flow: Flow.TopToBottom
27 flow: Flow.TopToBottom
28 property variant series
28 property variant series
29
29
30 Button {
30 Button {
31 text: "visible"
31 text: "visible"
32 onClicked: series.visible = !series.visible;
32 onClicked: series.visible = !series.visible;
33 }
33 }
34 Button {
34 Button {
35 text: "series hpos +"
35 text: "series hpos +"
36 onClicked: series.horizontalPosition += 0.1;
36 onClicked: series.horizontalPosition += 0.1;
37 }
37 }
38 Button {
38 Button {
39 text: "series hpos -"
39 text: "series hpos -"
40 onClicked: series.horizontalPosition -= 0.1;
40 onClicked: series.horizontalPosition -= 0.1;
41 }
41 }
42 Button {
42 Button {
43 text: "series vpos +"
43 text: "series vpos +"
44 onClicked: series.verticalPosition += 0.1;
44 onClicked: series.verticalPosition += 0.1;
45 }
45 }
46 Button {
46 Button {
47 text: "series vpos -"
47 text: "series vpos -"
48 onClicked: series.verticalPosition -= 0.1;
48 onClicked: series.verticalPosition -= 0.1;
49 }
49 }
50 Button {
50 Button {
51 text: "series size +"
51 text: "series size +"
52 onClicked: series.size += 0.1;
52 onClicked: series.size += 0.1;
53 }
53 }
54 Button {
54 Button {
55 text: "series size -"
55 text: "series size -"
56 onClicked: series.size -= 0.1;
56 onClicked: series.size -= 0.1;
57 }
57 }
58 Button {
58 Button {
59 text: "series start angle +"
59 text: "series start angle +"
60 onClicked: series.startAngle += 1.1;
60 onClicked: series.startAngle += 1.1;
61 }
61 }
62 Button {
62 Button {
63 text: "series start angle -"
63 text: "series start angle -"
64 onClicked: series.startAngle -= 1.1;
64 onClicked: series.startAngle -= 1.1;
65 }
65 }
66 Button {
66 Button {
67 text: "series end angle +"
67 text: "series end angle +"
68 onClicked: series.endAngle += 1.1;
68 onClicked: series.endAngle += 1.1;
69 }
69 }
70 Button {
70 Button {
71 text: "series end angle -"
71 text: "series end angle -"
72 onClicked: series.endAngle -= 1.1;
72 onClicked: series.endAngle -= 1.1;
73 }
73 }
74 Button {
74 Button {
75 text: "remove slice"
75 text: "remove slice"
76 onClicked: series.remove(series.at(series.count - 1));
76 onClicked: series.remove(series.at(series.count - 1));
77 }
77 }
78 Button {
78 Button {
79 text: "slice color"
79 text: "slice color"
80 onClicked: series.at(0).color = main.nextColor();
80 onClicked: series.at(0).color = main.nextColor();
81 }
81 }
82 Button {
82 Button {
83 text: "slice border color"
83 text: "slice border color"
84 onClicked: series.at(0).borderColor = main.nextColor();
84 onClicked: series.at(0).borderColor = main.nextColor();
85 }
85 }
86 Button {
86 Button {
87 text: "slice border width +"
87 text: "slice border width +"
88 onClicked: series.at(0).borderWidth++;
88 onClicked: series.at(0).borderWidth++;
89 }
89 }
90 Button {
90 Button {
91 text: "slice border width -"
91 text: "slice border width -"
92 onClicked: series.at(0).borderWidth--;
92 onClicked: series.at(0).borderWidth--;
93 }
93 }
94 Button {
94 Button {
95 text: "slice label visible"
95 text: "slice label visible"
96 onClicked: series.at(0).labelVisible = !series.at(0).labelVisible;
96 onClicked: series.at(0).labelVisible = !series.at(0).labelVisible;
97 }
97 }
98 Button {
98 Button {
99 text: "slice label position inside"
99 text: "slice label position inside"
100 onClicked: series.at(0).labelPosition = PieSlice.LabelInside;
100 onClicked: series.at(0).labelPosition = PieSlice.LabelInside;
101 }
101 }
102 Button {
102 Button {
103 text: "slice label position outside"
103 text: "slice label position outside"
104 onClicked: series.at(0).labelPosition = PieSlice.LabelOutside;
104 onClicked: series.at(0).labelPosition = PieSlice.LabelOutside;
105 }
105 }
106 Button {
106 Button {
107 text: "slice label arm len +"
107 text: "slice label arm len +"
108 onClicked: series.at(0).labelArmLengthFactor += 0.1;
108 onClicked: series.at(0).labelArmLengthFactor += 0.1;
109 }
109 }
110 Button {
110 Button {
111 text: "slice label arm len -"
111 text: "slice label arm len -"
112 onClicked: series.at(0).labelArmLengthFactor -= 0.1;
112 onClicked: series.at(0).labelArmLengthFactor -= 0.1;
113 }
113 }
114 Button {
114 Button {
115 text: "slice label color"
115 text: "slice label color"
116 onClicked: series.at(0).labelColor = main.nextColor();
116 onClicked: series.at(0).labelColor = main.nextColor();
117 }
117 }
118 Button {
118 Button {
119 text: "slice exploded"
119 text: "slice exploded"
120 onClicked: series.at(0).exploded = !series.at(0).exploded;
120 onClicked: series.at(0).exploded = !series.at(0).exploded;
121 }
121 }
122 Button {
122 Button {
123 text: "slice explode dist +"
123 text: "slice explode dist +"
124 onClicked: series.at(0).explodeDistanceFactor += 0.1;
124 onClicked: series.at(0).explodeDistanceFactor += 0.1;
125 }
125 }
126 Button {
126 Button {
127 text: "slice explode dist -"
127 text: "slice explode dist -"
128 onClicked: series.at(0).explodeDistanceFactor -= 0.1;
128 onClicked: series.at(0).explodeDistanceFactor -= 0.1;
129 }
129 }
130 Button {
131 text: "slice label fontsize -"
132 onClicked: series.at(0).labelFont.pixelSize -= 1;
133 }
134 Button {
135 text: "slice label fontsize +"
136 onClicked: series.at(0).labelFont.pixelSize += 1;
137 }
130 }
138 }
General Comments 0
You need to be logged in to leave comments. Login now