これが最もクリーンな方法であるかどうかはわかりませんが、私が思いついたのは次のとおりです。
<fx:Script>
<![CDATA[
import mx.charts.series.LineSeries;
import mx.collections.ArrayCollection;
[Bindable]
private var appData:ArrayCollection=new ArrayCollection([{State: "Georgia", Year: 2000, Percent: 15}, {State: "Georgia", Year: 2001, Percent: 12}, {State: "Georgia", Year: 2002, Percent: 5}, {State: "Maryland", Year: 1999, Percent: 12}, {State: "Maryland", Year: 2000, Percent: 7}]);
protected function creationComplete(event:Event):void
{
var states:Array=new Array("Georgia", "Maryland");
var series:Array=new Array();
for each (var state:Object in states)
{
var data:ArrayCollection=new ArrayCollection();
var ls:LineSeries=new LineSeries();
for (var i:int=0; i < appData.length; i++)
{
var currItem:String=appData.getItemAt(i).State;
if (currItem == state)
{
data.addItem(appData.getItemAt(i));
}
}
ls.yField="Percent";
ls.xField="Year";
ls.displayName=state.toString();
ls.dataProvider=data;
series.push(ls);
}
linechart.series=series;
}
]]>
</fx:Script>
<mx:Panel title="US States Data"
height="100%"
width="100%"
layout="horizontal">
<mx:LineChart id="linechart"
height="100%"
width="100%"
paddingLeft="5"
paddingRight="5"
showDataTips="true"
dataProvider="{appData}">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Year"/>
</mx:horizontalAxis>
</mx:LineChart>
<mx:Legend dataProvider="{linechart}"/>
</mx:Panel>