import mx.charts.ChartItem;
import mx.charts.chartClasses.Series;
import mx.charts.series.items.ColumnSeriesItem;
import mx.collections.ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"Jan", Income:2000, Expenses:1500},
{Month:"Feb", Income:1000, Expenses:200},
{Month:"Mar", Income:1500, Expenses:500}
]);
private function setCustomLabel(element:ChartItem,series:Series):String {
// Get a refereence to the current data element.
var data:ColumnSeriesItem = ColumnSeriesItem(element);
// Get a reference to the current series.
var currentSeries:ColumnSeries = ColumnSeries(series);
// Create a return String and format the number.
return currentSeries.yField + ":" + " $" + nf1.format(data.yNumber);
}
showDataTips="true">
categoryField="Month" />
yField="Income" displayName="Income"
labelFunction="setCustomLabel" />
yField="Expenses" displayName="Expenses"
labelFunction="setCustomLabel" />