So I whipped out my wand and wrote a custom LineSegmentRenderer which extends 
ShadowLineRenderer.  I used updateDisplayList to loop through the 
lineSeriesItems to draw my custom line.  

What I'm charting is surgical cases by day in a given month.  What I wanted to 
show was a linechart that had weekends colored differently so we'd know why the 
case counts plateaued.  I feel like I've just done my first bit of advanced 
coding in actionscript.  I know this isn't very advanced, but hopefully it will 
help someone else trying to achieve a similar effect.  I've left out some of 
the logic code, but you'll get the idea.

var items:Array = (data as LineSeriesSegment).items;
for (var i:int = 0; i < items.length; i++)
{
// get the graphics object
                                var g:Graphics = graphics;
                                
                                if (isWeekend)
                                {
                                        // use weekend lineStyle
                                        g.lineStyle(3, 0x990000, 1);
                                }
                                else
                                {
                                        // use the weekday lineStyle
                                        g.lineStyle(2, 0xF2F2F2, 1);
                                }
                                
                                // move to the starting point if we are at the 
first item
                                if (i==0)
                                        g.moveTo(thisItem.x, thisItem.y);
                                
                                // draw if we are not the last item
                                if (!lastItem)
                                {
                                        g.lineTo(nextItem.x, nextItem.y);
                                }
}



Reply via email to