@@ -19,17 +19,66 | |||
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | import QtQuick 1.0 |
|
22 | import QtCommercial.Chart 1.1 | |
|
22 | 23 | |
|
23 | 24 | Row { |
|
24 | 25 | anchors.fill: parent |
|
25 | 26 | spacing: 5 |
|
26 | 27 | property variant series |
|
28 | property int sliceIndex: 0 | |
|
27 | 29 | |
|
30 | // buttons for selecting the edited object: series, slice or label | |
|
28 | 31 | Flow { |
|
29 |
id: |
|
|
32 | id: editorSelectorFlow | |
|
30 | 33 | spacing: 5 |
|
31 | 34 | flow: Flow.TopToBottom |
|
35 | Button { | |
|
36 | id: seriesButton | |
|
37 | text: "series" | |
|
38 | unpressedColor: "#79bd8f" | |
|
39 | onClicked: { | |
|
40 | seriesFlow.visible = true; | |
|
41 | slicesFlow.visible = false; | |
|
42 | labelsFlow.visible = false; | |
|
43 | color = "#00a388"; | |
|
44 | sliceButton.color = "#79bd8f"; | |
|
45 | labelButton.color = "#79bd8f"; | |
|
46 | } | |
|
47 | } | |
|
48 | Button { | |
|
49 | id: sliceButton | |
|
50 | text: "slice" | |
|
51 | unpressedColor: "#79bd8f" | |
|
52 | onClicked: { | |
|
53 | seriesFlow.visible = false; | |
|
54 | slicesFlow.visible = true; | |
|
55 | labelsFlow.visible = false; | |
|
56 | color = "#00a388"; | |
|
57 | seriesButton.color = "#79bd8f"; | |
|
58 | labelButton.color = "#79bd8f"; | |
|
59 | } | |
|
60 | } | |
|
61 | Button { | |
|
62 | id: labelButton | |
|
63 | text: "label" | |
|
64 | unpressedColor: "#79bd8f" | |
|
65 | onClicked: { | |
|
66 | seriesFlow.visible = false; | |
|
67 | slicesFlow.visible = false; | |
|
68 | labelsFlow.visible = true; | |
|
69 | color = "#00a388"; | |
|
70 | seriesButton.color = "#79bd8f"; | |
|
71 | sliceButton.color = "#79bd8f"; | |
|
72 | } | |
|
73 | } | |
|
74 | } | |
|
32 | 75 | |
|
76 | // Buttons for editing series | |
|
77 | Flow { | |
|
78 | id: seriesFlow | |
|
79 | spacing: 5 | |
|
80 | flow: Flow.TopToBottom | |
|
81 | visible: false | |
|
33 | 82 | Button { |
|
34 | 83 | text: "visible" |
|
35 | 84 | onClicked: series.visible = !series.visible; |
@@ -74,69 +123,99 Row { | |||
|
74 | 123 | text: "series end angle -" |
|
75 | 124 | onClicked: series.endAngle -= 1.1; |
|
76 | 125 | } |
|
126 | } | |
|
127 | ||
|
128 | // Buttons for editing slices | |
|
129 | Flow { | |
|
130 | id: slicesFlow | |
|
131 | spacing: 5 | |
|
132 | flow: Flow.TopToBottom | |
|
133 | visible: false | |
|
134 | ||
|
135 | Button { | |
|
136 | text: "append slice" | |
|
137 | onClicked: series.append("slice" + (series.count + 1), 3.0); | |
|
138 | } | |
|
77 | 139 | Button { |
|
78 | 140 | text: "remove slice" |
|
79 | 141 | onClicked: series.remove(series.at(series.count - 1)); |
|
80 | 142 | } |
|
81 | 143 | Button { |
|
82 | 144 | text: "slice color" |
|
83 |
onClicked: series.at( |
|
|
145 | onClicked: series.at(sliceIndex).color = main.nextColor(); | |
|
84 | 146 | } |
|
85 | 147 | Button { |
|
86 | 148 | text: "slice border color" |
|
87 |
onClicked: series.at( |
|
|
149 | onClicked: series.at(sliceIndex).borderColor = main.nextColor(); | |
|
88 | 150 | } |
|
89 | 151 | Button { |
|
90 | 152 | text: "slice border width +" |
|
91 |
onClicked: series.at( |
|
|
153 | onClicked: series.at(sliceIndex).borderWidth++; | |
|
92 | 154 | } |
|
93 | 155 | Button { |
|
94 | 156 | text: "slice border width -" |
|
95 |
onClicked: series.at( |
|
|
157 | onClicked: series.at(sliceIndex).borderWidth--; | |
|
96 | 158 | } |
|
97 | 159 | Button { |
|
98 |
text: "slice |
|
|
99 |
onClicked: series.at( |
|
|
160 | text: "slice exploded" | |
|
161 | onClicked: series.at(sliceIndex).exploded = !series.at(sliceIndex).exploded; | |
|
100 | 162 | } |
|
101 | 163 | Button { |
|
102 |
text: "slice |
|
|
103 | onClicked: series.at(0).labelPosition = PieSlice.LabelInside; | |
|
164 | text: "slice explode dist +" | |
|
165 | onClicked: series.at(sliceIndex).explodeDistanceFactor += 0.1; | |
|
104 | 166 | } |
|
105 | 167 | Button { |
|
106 |
text: "slice |
|
|
107 | onClicked: series.at(0).labelPosition = PieSlice.LabelOutside; | |
|
168 | text: "slice explode dist -" | |
|
169 | onClicked: series.at(sliceIndex).explodeDistanceFactor -= 0.1; | |
|
108 | 170 | } |
|
171 | } | |
|
172 | ||
|
173 | // Buttons for editing labels | |
|
174 | Flow { | |
|
175 | id: labelsFlow | |
|
176 | spacing: 5 | |
|
177 | flow: Flow.TopToBottom | |
|
178 | visible: false | |
|
179 | ||
|
109 | 180 | Button { |
|
110 |
text: " |
|
|
111 | onClicked: series.at(0).labelArmLengthFactor += 0.1; | |
|
181 | text: "label visible" | |
|
182 | onClicked: series.at(sliceIndex).labelVisible = !series.at(sliceIndex).labelVisible; | |
|
112 | 183 | } |
|
113 | 184 | Button { |
|
114 |
text: " |
|
|
115 | onClicked: series.at(0).labelArmLengthFactor -= 0.1; | |
|
185 | text: "LabelInsideNormal" | |
|
186 | onClicked: series.at(sliceIndex).labelPosition = PieSlice.LabelInsideNormal; | |
|
116 | 187 | } |
|
117 | 188 | Button { |
|
118 |
text: " |
|
|
119 |
onClicked: series.at( |
|
|
189 | text: "LabelInsideHorizontal" | |
|
190 | onClicked: series.at(sliceIndex).labelPosition = PieSlice.LabelInsideHorizontal; | |
|
120 | 191 | } |
|
121 | 192 | Button { |
|
122 |
text: " |
|
|
123 | onClicked: series.at(0).exploded = !series.at(0).exploded; | |
|
193 | text: "LabelInsideTangential" | |
|
194 | onClicked: series.at(sliceIndex).labelPosition = PieSlice.LabelInsideTangential; | |
|
124 | 195 | } |
|
125 | 196 | Button { |
|
126 |
text: " |
|
|
127 | onClicked: series.at(0).explodeDistanceFactor += 0.1; | |
|
197 | text: "LabelOutside" | |
|
198 | onClicked: series.at(sliceIndex).labelPosition = PieSlice.LabelOutside; | |
|
128 | 199 | } |
|
129 | 200 | Button { |
|
130 |
text: " |
|
|
131 |
onClicked: series.at( |
|
|
201 | text: "label arm len +" | |
|
202 | onClicked: series.at(sliceIndex).labelArmLengthFactor += 0.1; | |
|
203 | } | |
|
204 | Button { | |
|
205 | text: "label arm len -" | |
|
206 | onClicked: series.at(sliceIndex).labelArmLengthFactor -= 0.1; | |
|
207 | } | |
|
208 | Button { | |
|
209 | text: "slice label color" | |
|
210 | onClicked: series.at(sliceIndex).labelColor = main.nextColor(); | |
|
132 | 211 | } |
|
133 | } | |
|
134 | 212 | |
|
135 | FontEditor { | |
|
136 | id: fontEditor | |
|
137 | fontDescription: "label" | |
|
138 | function editedFont() { | |
|
139 |
return series.at( |
|
|
213 | FontEditor { | |
|
214 | id: fontEditor | |
|
215 | fontDescription: "label" | |
|
216 | function editedFont() { | |
|
217 | return series.at(sliceIndex).labelFont; | |
|
218 | } | |
|
140 | 219 | } |
|
141 | 220 | } |
|
142 | 221 | } |
General Comments 0
You need to be logged in to leave comments.
Login now