Hey Doug!
My Flex Idol...! (one of them)  I'm familiar with your HSLIDER and others 
projects and have learned from them immensely.  I figured out the Item Data 
Renderer for the HLOC Item Series.
Not sure about posts etc. but I figured out the HLOC drawRect() issue below... 
If anyone wants to test it just bind an ArrayCollection to an HLOC Chart (or 
whatever) and use the Custom Data Renderer below as MXML>ItemRenders of 
HLOCSeries, it colors bars as green or red based on Open > Close or vice 
versa... but anyway, the issue with coloring the Close and Open bars regarding 
screen coordinate is that you have to subtract the HLOCSeriesItem.open from the 
HLOCSeriesItem.high = val:Number, then draw the rect at drawRect(val,0,length, 
weight) for both close and open ticks.  Below it just uses the value of open or 
close item, which does not compute from the origin of the HLOCItemSeries  for 
whatever reason... I am quite sure this is not documented anywhere.

Anyway, Doug, when I get to the W Coast we should get a beer.

Craig








--- In [email protected], Doug McCune <d...@...> wrote:
>
> Ha, I totally thought you meant try starting the post 1/2 pixel down from
> the previous post if he wanted someone to answer. "Why isn't anyone
> answering me?!?!?!" "Dude, your posts are off by a half pixel, duh."
> 
> On Sat, Oct 31, 2009 at 12:39 AM, dorkie dork from dorktown <
> dorkiedorkfromdorkt...@...> wrote:
> 
> >
> >
> > Maybe try starting them 1/2 to 1 pixel before your current positions and
> > 1/2 to 1px after your end position.
> >
> > On Fri, Oct 30, 2009 at 6:41 PM, cjsteury2 <cra...@...> wrote:
> >
> >>
> >>
> >>
> >>
> >> --- In [email protected] <flexcoders%40yahoogroups.com>,
> >> "cjsteury2" <craigj@> wrote:
> >> >
> >> > Okay... i have finally figured out how to write a custom itemrenderer
> >> for HOLC Chart Series Item... And the secret is posted below (about 99% of
> >> the way)... can anyone PLEASE tell me how to render the Open and Close Tick
> >> marks correctly?? Using this code they are a little off...
> >> >
> >> > I have tried to get the DrawRect() function a million diff ways but do
> >> not know what is throwing it off...
> >> >
> >> > package com.steury.controls.orders { // empty package.
> >> >
> >> > import flash.display.Graphics;
> >> > import mx.charts.series.items.HLOCSeriesItem;
> >> > import mx.core.IDataRenderer;
> >> > import mx.skins.ProgrammaticSkin;
> >> >
> >> > public class ChartColorRenderer extends mx.skins.ProgrammaticSkin
> >> > implements IDataRenderer{
> >> >
> >> > private var color:Number;
> >> > private var green:Number = 0x00ff00;
> >> > private var red:Number = 0xfe0000;
> >> > private var _hlocItem:HLOCSeriesItem;
> >> > private var open:Number;
> >> > private var close:Number;
> >> >
> >> > public function ChartColorRenderer() {
> >> > // Empty constructor.
> >> > }
> >> > public function get data():Object {
> >> > return _hlocItem;
> >> > }
> >> >
> >> > public function set data(value:Object):void {
> >> > _hlocItem = value as HLOCSeriesItem
> >> > invalidateDisplayList();
> >> > open=_hlocItem.openFilter;
> >> > close=_hlocItem.closeFilter;
> >> > }
> >> >
> >> > override protected function
> >> > updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void {
> >> > super.updateDisplayList(unscaledWidth, unscaledHeight);
> >> > if (open > close) color = red;
> >> > if (open < close) color = green;
> >> > var g:Graphics = graphics;
> >> > g.clear();
> >> > g.beginFill(color,1);
> >> > g.drawRect(0, 0, unscaledWidth, unscaledHeight);
> >> > g.endFill();
> >> > g.beginFill(color,1);
> >> > g.drawRect(open,0,10,1);
> >> > g.endFill();
> >> > g.beginFill(color,1);
> >> > g.drawRect(0,close,10,1);
> >> > g.endFill();
> >> > }
> >> > } // Close class.
> >> > } // Close package.
> >> >
> >>
> >>
> >  
> >
>


Reply via email to