If you can reorg the data provider a little, you can then specify the
field and nameField of the pie series like this:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml";>
<mx:Script><![CDATA[
   public var USAMedals:Object = [
                {Color: "Gold", Amount: 35},
                {Color: "Silver", Amount: 39},
                {Color: "Bronze", Amount: 29}
        ];
 ]]></mx:Script>
   <mx:PieChart id="chart" marginLeft="5" dataProvider="{USAMedals}"
height="100%" width="100%" marginRight="5" showDataTips="true">
    <mx:series>
     <mx:Array>
       <mx:PieSeries labelPosition="callout" field="Amount"
nameField="Color"/>
     </mx:Array>
    </mx:series>
   </mx:PieChart>
</mx:Application> 

> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of nicy_neha
> Sent: Monday, January 09, 2006 1:43 AM
> To: [email protected]
> Subject: [flexcoders] problem in displaying pie chart
> 
> I want to draw a pie chart  displaying two values -Gold & 
> Silver of same object...
> 
> <mx:Script>
>         <![CDATA[
>           
>           var Medals = [{Country: "USA", Gold: 35, Silver:39,
> Bronze: 29}]
> 
>  ]]>
>     </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" >
>                         </mx:PieSeries>
>                       
>                     </mx:Array>
> 
>                 </mx:series>
> 
>             </mx:PieChart>
> 
>         </mx:HBox>
> 
>     </mx:Panel>
> 
> </mx:Application>
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to