<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating custom fills in a Flex PieChart control using the fillFunction property</title>
	<atom:link href="http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Fri, 19 Mar 2010 20:35:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Greg</title>
		<link>http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/comment-page-1/#comment-1828</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Fri, 24 Apr 2009 09:23:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/#comment-1828</guid>
		<description>How can I create a pie chart that uses dynamic data from ArrayCollection ? (I have a web page that does a cycles between the stats and then on the endState it generates all information in one RichTextEditor and then just add the text information into the DataGrid (3 rows) and now I want to create a pieChart that will use the data from one row and then generate a pieChart.</description>
		<content:encoded><![CDATA[<p>How can I create a pie chart that uses dynamic data from ArrayCollection ? (I have a web page that does a cycles between the stats and then on the endState it generates all information in one RichTextEditor and then just add the text information into the DataGrid (3 rows) and now I want to create a pieChart that will use the data from one row and then generate a pieChart.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cosmoz</title>
		<link>http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/comment-page-1/#comment-1826</link>
		<dc:creator>cosmoz</dc:creator>
		<pubDate>Mon, 21 Jan 2008 11:13:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/#comment-1826</guid>
		<description>At last, I found another way to modified the fill color in runtime. (For Flex 2.0, if you have 3.0 then it&#039;s easier by use fillFunction)

The key is to define an Array to store the default color data.(any color)

eg.
&lt;pre class=&quot;code&quot;&gt;
private var pieColor:Array = [0x000000, 0x000000, 0x000000, 0x000000];
&lt;/pre&gt;

Then set it to PieSeries attributes : fills=&quot;{pieColor}&quot;

And replace each color in that array through the code!! That&#039;s it.

One thing is the number of data that I used hasn&#039;t change so I&#039;m not sure it will work for dynamic number of data.


The code is below is:
&lt;pre class=&quot;code&quot;&gt;
private var pieColor:Array = [0x000000, 0x000000, 0x000000, 0x000000];

private function changeColor():void{

pieColor[0] = getColor(&#039;red&#039;);
	pieColor[1] = getColor(&#039;amber&#039;);
	pieColor[2] = getColor(&#039;green&#039;);
	pieColor[3] = getColor(&#039;default&#039;);
}


private function getColor(color:String):uint {
	trace(&quot;--getColor--: &quot;   color);
	switch(color){
		case &quot;red&quot;:
			return 0xFF0000;
		case &quot;green&quot;:
			return 0x00FF00;
		case &quot;amber&quot;:
			return 0xFFCC00;
		default:
			return 0x8800CC;
	}
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>At last, I found another way to modified the fill color in runtime. (For Flex 2.0, if you have 3.0 then it&#8217;s easier by use fillFunction)</p>
<p>The key is to define an Array to store the default color data.(any color)</p>
<p>eg.</p>
<pre class="code">
private var pieColor:Array = [0x000000, 0x000000, 0x000000, 0x000000];
</pre>
<p>Then set it to PieSeries attributes : fills=&#8221;{pieColor}&#8221;</p>
<p>And replace each color in that array through the code!! That&#8217;s it.</p>
<p>One thing is the number of data that I used hasn&#8217;t change so I&#8217;m not sure it will work for dynamic number of data.</p>
<p>The code is below is:</p>
<pre class="code">
private var pieColor:Array = [0x000000, 0x000000, 0x000000, 0x000000];

private function changeColor():void{

pieColor[0] = getColor('red');
	pieColor[1] = getColor('amber');
	pieColor[2] = getColor('green');
	pieColor[3] = getColor('default');
}

private function getColor(color:String):uint {
	trace("--getColor--: "   color);
	switch(color){
		case "red":
			return 0xFF0000;
		case "green":
			return 0x00FF00;
		case "amber":
			return 0xFFCC00;
		default:
			return 0x8800CC;
	}
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: cosmoz</title>
		<link>http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/comment-page-1/#comment-1827</link>
		<dc:creator>cosmoz</dc:creator>
		<pubDate>Mon, 21 Jan 2008 08:11:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/07/creating-custom-fills-in-a-flex-piechart-control-using-the-fillfunction-property/#comment-1827</guid>
		<description>Is this &#039;fillFunction&#039; work only for Flex 3.0? And if it is any possible method to do the same in flex 2.0?

I&#039;m looking around the web and can not found the solution for flex 2.0.</description>
		<content:encoded><![CDATA[<p>Is this &#8216;fillFunction&#8217; work only for Flex 3.0? And if it is any possible method to do the same in flex 2.0?</p>
<p>I&#8217;m looking around the web and can not found the solution for flex 2.0.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
