Okay, I've updated my code and added a few more examples.  Also, I
added the ability to use the PieSeries labelFunction to get the
category from.

--- In [email protected], "Ely Greenfield" <[EMAIL PROTECTED]> wrote:
>
>  
>  
> Pretty much. The base wedge renderer, on the next line, does this:
>  
> var outerRadius:Number = wedge.outerRadius - SHADOW_INSET;
>  
>  
> and elsewhere in the class declares:
>  
> public const SHADOW_INSET:Number = 8;
>  
>  
> Ely.
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Jason
> Sent: Friday, June 16, 2006 9:34 AM
> To: [email protected]
> Subject: [flexcoders] Re: example code to color pie wedges based on
> predefined categories
> 
> 
> 
> Ignore my other post. I started it before yours was posted but took a
> long time to finish it.
> 
> So, do you mind giving me a diff to correct my code? Is it just this
> line that needs changing?:
> 
> var outerRadius:Number = wedge.outerRadius;
> 
> to
> 
> var outerRadius:Number = wedge.outerRadius - 8;
> 
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>
> , "Ely Greenfield" <egreenfi@> wrote:
> >
> > 
> > 
> > 
> > Hmmm...looking at the default wedge renderer, I believe it insets its
> > bounding area about 8 pixels in both directions to keep the dropshadow
> > from sticking out over the edges.
> > 
> > Ely.
> > 
> > 
> > ________________________________
> > 
> > From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of Jason
> > Sent: Friday, June 16, 2006 7:31 AM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: example code to color pie wedges based on
> > predefined categories
> > 
> > 
> > 
> > Actually, I'm glad you bring that up. While I don't actually see
> > wedges dropping shadows onto other wedges, what I do see is the pie
> > being slightly larger than it should be. This means it gets cut off
> > on the bottom or right as you resize the browser page. I completely
> > don't understand this as I didn't change any part of your wedge
> > drawing code. This happens even if at the top of getfill I put: 
> > 
> > return categories[0].fill
> > 
> > So it's none of that code, either. I don't get what it could be.
> > 
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > , "Ely Greenfield" <egreenfi@> wrote:
> > >
> > > 
> > > 
> > > Hey, very cool Jason.
> > > 
> > > One question -- your app seems to have a drop shadow per
> wedge...which
> > > makes wedges drop shadows onto other wedges. Is that intentional? At
> > > first glance, I can't see if anything in your code caused that.
> > > 
> > > Ely.
> > > 
> > > 
> > > ________________________________
> > > 
> > > From: [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > [mailto:[email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > ] On
> > > Behalf Of Jason
> > > Sent: Thursday, June 15, 2006 2:09 PM
> > > To: [email protected] <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com> 
> > > Subject: [flexcoders] example code to color pie wedges based on
> > > predefined categories
> > > 
> > > 
> > > 
> > > Okay, long long ago I posted wanting to figure out how to tell a
> > > PieSeries which colors to use for the data based on a field in the
> > data.
> > > Ely posted some related code that helped a lot. I've only just now
> > > gotten comfortable enough to understand and modify it for my needs.
> > > 
> > > I figured I would post about it here in case anyone else wants to
> use
> > > it. 
> > > 
> > > http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.htm
> <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.htm> 
> > <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.htm
> <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.htm> > 
> > > <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html
> <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html> 
> > <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html
> <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html> > > 
> > > l <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html
> <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html> 
> > <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html
> <http://three.fsphost.com/flex2/PieCategory/PieCategoryApp.html> > >
> > > http://three.fsphost.com/flex2/PieCategory/srcview/
> <http://three.fsphost.com/flex2/PieCategory/srcview/> 
> > <http://three.fsphost.com/flex2/PieCategory/srcview/
> <http://three.fsphost.com/flex2/PieCategory/srcview/> > 
> > > 
> > > Here's an example of how you use it:
> > > 
> > > <mx:PieSeries field="@costs" nameField="@month"
> > > labelPosition="insideWithCallout" labelFunction="getLabel">
> > > <mx:itemRenderer>
> > > &n! bsp; <mx:Component>
> > > <nes:PieCategoryWedgeRenderer
> > > xmlns:qc="nes.charts.dataRenderers.*">
> > > <nes:categories>
> > > <nes:PieCategory value="January" field="@month">
> > > <nes:fill>
> > > <mx:LinearGradient>
> > > <mx:entries>
> > > <mx:Array>
> > > ! <mx:Gradie! ntEntry color="0x000000" ratio="33"/>
> > > <mx:GradientEntry color="0xFF0000" ratio="90"/>
> > > </mx:Array>
> > > </mx:entries>
> > > </mx:LinearGradient>
> > > </nes:fill>
> > > </nes:PieCategory>
> > > <nes:PieCategory value="February" field="@month"
> > > color="#00FF00"/>
> > > ! ; <nes:PieCategory value="March" field="@month"
> > > color="#0000FF" alpha="0.2"/>
> > > 
> > > </nes:categories>
> > > </nes:PieCategoryWedgeRenderer>
> > > </mx:Component>
> > > </mx:itemRenderer>
> > > </mx:PieSeries>
> > > 
> > > 
> > > 
> > > Note that you can either put your own fill or you can use the
> > > color/alpha properties of the PieCategory element and it will do a
> > > SolidColor field for you. If you omit the "field" from the
> > PieCategory,
> > > it will use the PieSeries "nameField" if available.
> > > 
> > > This is a first whack, so feel free to make any suggestions. Thanks
> to
> > > Ely for providing the stoplight example. Always remember when a
> > > developer says somethin! g is "not too hard", they mean if you
> already
> > > know how to do i! t. ;)
> > >
> >
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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