Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-04-2009, 05:21 PM   #1
Registered User
Join Date: Dec 2009
Posts: 2
Default Pie Chart Color from XML


i am working on a Dashboard Application, the legend would in be in JSP/HTML and the Chart itself in flex, now my questions is how can i define the slice color from XML ?

Thank you
nxfxcom is offline   Reply With Quote
Old 12-04-2009, 06:52 PM   #2
Registered User
Join Date: Dec 2009
Posts: 2

Below is my current code

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="srv.send()" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]" borderColor="#FFFFFF">
  	import mx.collections.ListCollectionView;
    import mx.utils.ArrayUtil;

  <mx:HTTPService id="srv" url="../xml/sourcesPie.xml" resultFormat="e4x" />

  <mx:XMLListCollection id="myAC" source="{srv.lastResult.entry}" />
   <mx:Panel styleName="opaquePanel"
            height="100%" title="Sources" horizontalAlign="left">
        <mx:HBox width="100%" height="100%">
  <mx:PieChart id="myChart" dataProvider="{myAC}" showDataTips="false" width="100%" height="100%">
        <mx:PieSeries field="views" fontSize="13" labelPosition="insideWithCallout" displayName="views" name="views" nameField="source"  />

   <mx:Legend dataProvider="{myChart}"
                    width="20%" />
                      <mx:DataGrid dataProvider="{myAC}">
  		<mx:DataGridColumn headerText="Source" dataField="source"/>
  		<mx:DataGridColumn headerText="Views" dataField="views"/>
  		<mx:DataGridColumn headerText="%" dataField="perc"/>


And then my xml, i want the pie charts to get the right color as defined in XML

nxfxcom is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:57 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.