Adobe Flex 3 Help

About the series classes

The chart series classes let you specify what data to render in a chart control. All series classes are subclasses of the mx.charts.chartClasses.Series class.

Each chart type has its own series class; for example, a BarChart control has a BarSeries class that defines the data to render in the BarChart. A PieChart control has a PieSeries.

The primary purpose of a series is to define what data to render in the chart. You use the series to define what field in a data provider the chat should use to render chart items on the X and Y axes. You use the xField property (for the horizontal axis) and the yField property (for the vertical axis) to define these fields.

Each series is made up of an Array of series items. The classes that define the series items are specific to each series type. For example, a BarSeries is made up of BarSeriesItem objects. A ColumnSeries is made up of ColumnSeriesItem objects. The series items encapsulate all the information about the particular data point, including the minimum value, the fill, the x value and the y value.

When you create a new series, you typically define the displayName of that series. This property represents the series to the user in labels such as DataTip objects.

A BarChart typically specifies one or more BarSeries objects that define what set of bars to render in the chart. By default, bars and columns are clustered. However, you can also define alternate ways to group, or "stack", series in the chart control. For example, AreaSeries, ColumnSeries, and BarSeries can be stacked or overlaid. They can also render as 100% charts. You can further control how multiple series are grouped by using sets. For example, for a group of BarSeries objects, you use the BarSet class; for a group of ColumnSeries objects, you use the ColumnSet class. For more information on grouping series, see Stacking charts.

Most charts use only one kind of series. However, you can specify a second series for a chart, so that a chart control can have a series of bars in addition to a line that "floats" over it. This is useful for rendering trend-lines or showing different types of data on a single chart for comparison analysis. For more information, see Using multiple data series.

You use the series classes to define the appearance of the chart items. You can change the fill of all series items by using the fill property on the series. In addition, you can define the fill of each item in a series by using the fills property. You can also customize the fill that each chart item has based on its value by using the fillFunction on the series. For more information Using fills with chart controls.

You can also apply filters to series to give them effects such as drop shadows, blurs, and glows. For more information, see Using filters with chart controls.

You can add data labels to series items. You do this by setting the value of the labelPosition property on the series. For most series, possible values of labelPosition are inside and outside, which draw the labels inside the chart item and outside the chart item, respectively. For a PieSeries, you can also set the labelPosition property to other values that include callout and insideWithCallout.

You can customize data labels by using a labelFunction. This callback function takes arguments that define the series item and returns a String that is then rendered on the series item.

For information about adding data labels to your charts, see Using data labels.

Series also let you set a minField value. This property lets you specify a minimum value that the series displays. For more information, see Using the minField property.