
Chart types 79
Defining chart data
The chart controls all take a dataProvider property that defines the data for the chart. A
data provider is a collection of objects, similar to an array. The chart components use a flat, or
list-based, data provider, similar to a one-dimensional array.
A data provider consists of two parts: a collection of data objects and an API. The data
provider API is a set of methods and properties that a class must implement so that a Flex
component recognizes it as a data provider.
The data provider creates a level of abstraction between Flex components and the data that
you use to populate them. You can populate multiple components from the same data
provider, switch data providers for a component at runtime, and modify the data provider so
that changes are reflected by all components that use the data provider.
For more information about using data providers in Flex, see Chapter 7, “Using Data
Providers and Collections,” in Flex 2 Developer’s Guide.
Chart types
Flex supports many of the most common types of charts, including bar charts, line charts, pie
charts, and others. This section describes the set of charts supplied with Flex. In addition to
these chart types, you can also extend the CartesianChart control to create custom charts.
Area charts
You use the AreaChart control to represent data as an area bounded by a line connecting the
values in the data. The area underneath the line is filled in with a color or pattern. You can use
an icon or symbol to represent each data point along the line, or show a simple line without
icons.
The following figure shows an example of an area chart:
Se
ment
Ste
Vertical
Commenti su questo manuale