<?xml version="1.0"?>
<!-- 折れ線グラフと面グラフの使用方法を示す簡単な例 -->
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF">
<mx:Script>
<![CDATA[
var expenses = [{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="Line and Area Chart Panel" height="100%" width="100%">
<mx:HBox id="box" height="100%" width="100%">
<mx:LineChart id="linechart" marginLeft="5" height="100%" width="45%"
marginRight="5" dataProvider="{expenses}" showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{expenses}" categoryField="Month"/>
</mx:horizontalAxis>
<mx:series>
<mx:Array>
<mx:LineSeries yField="Profit" form="curve" name="Profit"/>
<mx:LineSeries yField="Expenses" form="curve" name="Expenses"/>
<mx:LineSeries yField="Amount" form="curve" name="Amount"/>
</mx:Array>
</mx:series>
</mx:LineChart>
<mx:Legend dataProvider="linechart"/>
<mx:AreaChart id="Areachart" marginLeft="5" height="100%" width="45%"
marginRight="5" dataProvider="{expenses}" showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{expenses}" categoryField="Month"/>
</mx:horizontalAxis>
<mx:series>
<mx:Array>
<mx:AreaSeries yField="Profit" form="curve" name="Profit"/>
<mx:AreaSeries yField="Expenses" form="curve" name="Expenses"/>
<mx:AreaSeries yField="Amount" form="curve" name="Amount"/>
</mx:Array>
</mx:series>
</mx:AreaChart>
<mx:Legend dataProvider="Areachart"/>
</mx:HBox>
</mx:Panel>
</mx:Application>
|