<?xml version="1.0"?>
<!-- 円グラフの使用方法を示す簡単な例 -->
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF">
<mx:Script>
<![CDATA[
var Medals = [{Country:"USA", Gold:35, Silver:39, Bronze: 29},
{Country:"China", Gold:32, Silver:17, Bronze: 14},
{Country:"Russia", Gold:27, Silver:27, Bronze: 38}
]
function displayGold(data, field, index, percentValue)
{
var temp= (" " + percentValue).substr(0,6);
return data.Country + ":" + newline + "Total Gold:" + data.Gold + newline + temp + "%";
}
]]>
</mx:Script>
<mx:Panel title="Olympics 2004 Medals Tally Panel" height="100%" width="50%">
<mx:HBox id="box" height="100%" width="100%">
<mx:PieChart id="chart" marginLeft="5" dataProvider="{Medals}" height="100%" width="100%"
marginRight="5" showDataTips="true">
<mx:series>
<mx:Array>
<mx:PieSeries labelPosition="callout" field="Gold" labelFunction="displayGold">
<mx:calloutStroke>
<mx:Stroke weight="0" color="0x888888" alpha="100"/>
</mx:calloutStroke>
<mx:radialStroke>
<mx:Stroke weight="0" color="#FFFFFF" alpha="20"/>
</mx:radialStroke>
<mx:stroke>
<mx:Stroke color="0" alpha="20" weight="2"/>
</mx:stroke>
</mx:PieSeries>
</mx:Array>
</mx:series>
</mx:PieChart>
</mx:HBox>
</mx:Panel>
</mx:Application>
|