Nice.  I don't see a lot of charting examples but this is nice because I'm
about to start a project plotting multiple items dealing with commodities
and futures and I'm sure I'll need to customize it quite a bit.

 

Jake Churchill
CF Webtools
11204 Davenport, Ste. 100
Omaha, NE  68154
 <http://www.cfwebtools.com> http://www.cfwebtools.com
402-408-3733 x103

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of jdizowat
Sent: Friday, May 22, 2009 10:36 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: LineChart Magic

 






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);
}
}



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.36/2126 - Release Date: 05/22/09
06:03:00

Reply via email to