代码如下: <?xml version="1.0" encoding="utf-8"?> <!-- charts/BasicLine.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script><!--[CDATA[ import mx.collections.ArrayCollection; [Bindable] public var expenses:ArrayCollection = new ArrayCollection([ {Month:"Jan", Profit:2000, Expenses:1500, Amount:450}, {Month:"Feb", Profit:1000, Expenses:200, Amount:600}, {Month:"Mar", Profit:1500, Expenses:500, Amount:300} ]); ]]--></mx:Script> <mx:Panel title="折线图表示例"> <mx:LineChart id="myChart" dataProvider="{expenses}" showDataTips="true" > <mx:horizontalAxis> <mx:CategoryAxis dataProvider="{expenses}" categoryField="Month" /> </mx:horizontalAxis> <mx:series> <mx:LineSeries yField="Profit" displayName="Profit" /> <mx:LineSeries yField="Expenses" displayName="Expenses" /> </mx:series> </mx:LineChart> <mx:Legend dataProvider="{myChart}"/> </mx:Panel> </mx:Application> 图表如下图所示: