flex line chrat 例子

flex曲线图例子如下:
myflex.mxml:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%">
<mx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Day: "11", Profit: 2000, Expenses: 1500, Amount: 450},
{Day: "12", Profit: 1000, Expenses: 200, Amount: 600},
{Day: "13", Profit: 1500, Expenses: 500, Amount: 300},
{Day: "14", Profit: 1000, Expenses: 800, Amount: 600} ,
{Day: "15", Profit: 1100, Expenses: 700, Amount: 300} ,
{Day: "16", Profit: 1500, Expenses: 600, Amount: 600} ,
{Day: "17", Profit: 1800, Expenses: 900, Amount: 700} ,
{Day: "18", Profit: 600, Expenses: 1000, Amount: 900} ,
{Day: "19", Profit: 800, Expenses: 1300, Amount: 100},
{Day: "20", Profit: 500, Expenses: 800, Amount: 300}
]);
]]></mx:Script>
<mx:Panel title="曲线图" fontSize="20" width="100%">
<mx:LineChart dataProvider="{expenses}" showDataTips="true" width="100%">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{expenses}" categoryField="Day"/>
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries yField="Profit" displayName="111" />
<mx:LineSeries yField="Expenses" displayName="曲线" />
<mx:LineSeries yField="Amount" displayName="Amount"/>
</mx:series>
</mx:LineChart>
</mx:Panel>
</mx:Application>


运行这个mxml 如下图所示.
阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页