The easiest of these is the interpolate. To animate a chart, you must first define the animation. This is
done in the Source view by creating the tag shown in Figure 10-23. Add this code after the HTTPService
and before the panels in the MXML.
206
CHAPTER 10
Figure 10-23. Interpolate animation
You can see in this tag that it defines the kind of movement (interpolate), gives the animation an ID
(chartChange) so that we can call on it, and specifies a duration in milliseconds (in this case 2000, or 2
seconds). Add this tag to your MXML??”we will be coming back to call on it once we create our line chart.
1. First we need to create the line chart. In the Design view, drag a LineChart component onto the
panel named Overall Marks ??“ Line Chart. We will be going through much the same process to
create this one as we did with the column chart.
2. When you release your chart, you will see the Create Chart dialog box. Add the elements shown
in Figure 10-24. We will not need the legend for this chart, so deselect the Include
legend check box.
3. Adjust the size of the chart so that it fits in your panel and enter {student} for the Data provider
property (Figure 10-25). Set the Show data tips attribute to true.
Figure 10-25. Line chart properties
Figure 10-24. Use these settings in
the Create Chart dialog box.
207
EXPLORING FLEX CHARTING
4. As we did for the column chart, switch to the Source view and add the yField and
horizontalAxis information, as shown in Figure 10-26.
Pages:
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152