Thanks for the details on the options, especially #3.

> 1) Use the data graphics drawing API (see the post on my blog).

Excellent; I'll start with this (I need to demo a proof-of-concept
this weekend).  QuietlyScheming is still refusing my connection,
though (it must know I want to do unsavory things with dataTips).

> 2) Write a custom item renderer

Once I'm in updateDisplayList() and I have access to the _ChartItem,
is it possible to then output the contents of a data field from the
item (e.g. _ChartItem.hitData.item.NAME in a Label to output
"Smith,John" via addChild() or something), or is it restricted to pure
Graphics drawing methods?

> 3) Write a custom series (or extension to plot series)

I like that as my eventual solution; and assuming that the answer to
the above question is "no", I assume this would be the only way to
embed data provider fields (e.g. "Smith,John" from the ChartItem) into
the ItemRenderer?

thanks again,
-Peter Demling
 Lexington, MA


--- In [email protected], "Ely Greenfield" <[EMAIL PROTECTED]> wrote:
>
>  
> 
>  
> 
> DataTips were really written to be interactive tips, while a lot of
> people have asked for functionality that allows you to treat them more
> like labels. We hear the request, and are considering ways to update it
> for a future release.
> 
>  
> 
> If I wanted to put labels on the plot items, I'd probably, in increasing
> order of difficulty: 
> 
>  
> 
> 1)      Use the data graphics drawing API (see the post on my blog).
> Pro: very easy.  Con:  less performant.
> 
> 2)      Write a custom item renderer. Pro:  more performant, leverages
> existing plot series. Con: axes won't automatically make sure there's
> enough room for the labels.
> 
> 3)      Write a custom series (or extension to plot series).  Pro:  best
> performance option, best experience (can make the chart axes make room
> for labels).  Con:  requires understanding writing custom series.
> 
>  
> 
>  
> 
> Personally, I'd suggest taking a shot at #3.  Writing a custom series
> really isn't all that difficult, esp. for a plot series, which is the
> simplest kind.  I'd probably try this:
> 
>  
> 
> 1)      Extend PlotSeries.
> 
> 2)      In the constructor for your extension, create a UIComponent and
> addChild it. This will be the sprite that will contain your labels.
> 
> 3)      Override the get labelLayer property, and return a reference to
> that UIComponent.  This makes sure the chart adds it to your display,
> above all the series, so labels don't appear under items.
> 
> 4)      Override updateDisplayList.  First call the super.  Second, for
> each chart item in the renderData.filteredCache array, create a Label
> (or some custom component), position it where you want relative to the
> x/y values in the chart item, and add it as a child to your labelLayer.
> 
> 5)      Override describeData. This is the method where you tell the
> axes what range your data represents.  You also have the option of
> telling the series that you need a certain number of pixels on either
> size of your data.  You'll want to report to the axis that you need
> space to the right of your data for the label.  See the ASDoc for
> describeData for more details.
> 
> 6)      Optimize.  Reuse your labels in your updateDisplayList function,
> etc.
> 
> 7)      Deal with transitions, if you want.  Eearlier I said that in
> updateDisplayList, you want to look at the renderData.filteredCache
> array. With transitions, it's a little more complicated.  You might have
> a transitionRenderData property, in which case you want to use that.
> Your transition render data property might have an elementBounds array,
> in which case you want to use that instead.  Honestly, in my experience,
> it's better to hide labels during transitions, so probably you just want
> to see if you have a transitionRenderData value, and hide all your
> labels if you do.  See PlotSeries.updateDisplayList for an example of
> how to deal with transitions and render data.
> 
>  
> 
> Ely.


Reply via email to