Specifically, it uses the HTTPService to bring in the data and then stores it in
the student XMLList. It is the data in student that our DataGrid and Charts components will call. We
also have some code that will populate a ComboBox component that will allow us to jump between
two different XML files, one called firstSemester.xml and the other called secondSemester.xml
(Figure 10-6). Each of the XML files has the names and grades of six students. It is this data that we are
charting.
198
CHAPTER 10
Figure 10-5. Our ActionScript
Figure 10-6. Variable to be used for our ComboBox
199
EXPLORING FLEX CHARTING
Building the layout
To control the layout, we will be using three panels. The first panel will be largest and will contain the
DataGrid and Column Chart. The second and third will contain the Pie Chart and Line Chart.
1. Switch back to the Design view, and drag out three Panel components and arrange them, as
shown in Figure 10-7. You do not need to get it exactly the same??”a rough estimate is fine.
Figure 10-7. Panel layout
For each of the panels, add the appropriate titles in the Title property of the component.
Adding the DataGrid
The DataGrid component is useful for seeing the exact values of a set of data. We??™ll connect it to our
XML files so that we can see the names and marks of all the students. You can find this component in
the Controls folder in the Components window.
1. Drag a DataGrid component onto the Students??™ Marks panel and expand it to fit (Figure 10-8).
Pages:
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147