Thông tin tài liệu:
Flash Builder 4 and Flex 4 Bible- P15: When Macromedia first released Flash MX in 2002, the product was branded as the newway to build Rich Internet Applications (known by the acronym RIA). The term wasinvented at Macromedia to describe a new class of applications that would offer thebenefits of being connected to the Internet, including access to various types of Web-based services,but would solve many of the nagging issues that had been inherent in browser-based applicationssince the mid-1990s....
Nội dung trích xuất từ tài liệu:
Flash Builder 4 and Flex 4 Bible- P15 Chapter 21: Using the Flex Charting Controls The application in Listing 21.8 displays a line chart and an area chart using the same data. LISTING 21.8 Line and area charts On the WebThe application in Listing 21.8 is available in the Web site files as LineAndAreaDemo.mxml in thechapter20 project. n 671Part III: Working with Data Both the LineSeries and AreaSeries components can adjust the shape of their lines based on their form property. As displayed in Figure 21.13, the form property has these possible values: l curve. Draws curves between data points. l horizontal. Draws vertical lines from the x coordinate of the current point to the x coordinate of the next point. l reverseStep. Draws vertical and then horizontal lines to connect data points. l segment (the default). Draws straight lines to connect data points. l step. Draws horizontal and then vertical lines to connect data points. l vertical. Draws vertical lines from the y coordinate of the current point to the y coor- dinate of the next point. Figure 21.14 shows the six different forms of line charts. FIGURE 21.14The different forms of line chartsOn the WebThe application shown in Figure 21.14 is available in the Web site files as LineFormDemo.mxml in thechapter20 project. n672 Chapter 21: Using the Flex Charting ControlsSummaryIn this chapter, I described how to use the Flex Charting controls to display data graphically in aFlex application. You learned the following: l The Flex Charting controls are part of the Data Visualization components and are included with a license for Flash Builder 4 Premium. l There are nine types of charts. l You can determine the visual presentation of a chart by setting its data, properties, and styles. l Pie charts also can be displayed as doughnut charts with hollow centers. l HLOC and candlestick charts are designed to show financial information. l The bar, column, line, and area charts are designed to show comparative or trend data. 673 CHAPTERWorking with DataEntry FormsW hen you start to integrate data into a Flex application, you have to solve the problem of how to get data into the Flex runtime IN THIS CHAPTER environment. As you have seen in earlier chapters, you can Using the Form containerembed data into the application using hard-coded MXML or ActionScript, orby integrating data into the application with the tag. These Creating a Form componentstrategies, however, only work for data that’s both small and static. Laying out Form controls withFor existing data that’s retrieved from a server-based resource, such as a the FormItem containerdatabase or an EXtensible Markup Language (XML) file, you can use Remote Validating data entryProcedure Call (RPC) components such as HTTPService, WebService,and RemoteObject. Sharing data with value objects and custom eventsCross-ReferenceFor more information about HTTPService, WebService, andRemoteObject RPC components, see Chapters 23, 25, 26, 28, and 29. nAnd then there’s data that comes from the user. Unless an application is usedexclusively with static data or content retrieved from a server at runtime, adata-centric application must collect data from the user. In this chapter, Idescribe using the following tools for building data entry form components: l The Form, FormHeading, and FormItem components for laying out a data entry form l Validator components to validate a user’s data entry l Custom value object and event classes to share data with the rest of the applicationThis chapter also includes tutorials that enable you to integrate many of thetechniques described in prece ...