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. From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Demling Sent: Friday, May 18, 2007 10:15 AM To: [email protected] Subject: [flexcoders] Re: Setting dataTipCalloutStroke="{null}" when dataTipMode="multiple"? Thanks for the reply, Ely! I really appreciate your input. > myChart.setStyle("calloutStroke",null); This works to hide the calloutStroke... ...but the positions of the dataTip boxes still get offset from the chartItems (in my case, far away from the DiamondItemRenderers of my plotSeries). In other words, when dataTipMode="multiple", I want the dataTip boxes to position themselves like they do when dataTipMode="single": i.e., a few pixels to the northeast of the chartItem. My real end goal is to show the all the items in the plotSeries, with their corresponding dataTips right next to them (I'm using a high mouseSensitivity to forcibly show multiple dataTips right now, but I know I'll eventually have to explicitly dispatch MOUSE_OVER, or else override findDataPoints and toggle all the showDataTips value to false/true). If I can't force the offset-positioning of these dataTips in order to align nicely with their chartItems, do you think I need to use a custom ItemRenderer instead? Your "StoplightItemRenderer" example at qs* is quite helpful in this regard, but I can't figure out how I'd also draw text values from the chartItem adjacent to the DiamondItemRenderer (e.g., "Smith,John (age 30)" adjacent to the diamond graphic). Thanks again for any suggestions; believe me, little bumps in the road like this don't take away from the enormous benefit this charting API has already been for us. Regards, -Peter Demling Lexington, MA *is quietlyScheming.com down? I lost connection this morning... --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Ely Greenfield" <[EMAIL PROTECTED]> wrote: > > > > > > Peter - > > > > Took a peek at the code, and that looks to be an unfortunately bug on my > part. Use 'calloutStroke' instead of 'dataTipCalloutStroke' style. You > might have to set it programmatically: > > > > myChart.setStyle("calloutStroke",null); > > > > That should solve the problem (and in a more performant way). > > > > Ely. > > > > > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of Peter Demling > Sent: Friday, May 18, 2007 7:19 AM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Setting dataTipCalloutStroke="{null}" when > dataTipMode="multiple"? > > > > Hello, > > I have a CartesianChart where I don't want the calloutStroke to be > drawn (and thereby offset the positioning of the dataTips from their > data point), so I've set dataTipCalloutStroke="{null}". > > This works fine when dataTipMode="single", but it does not work when I > set dataTipMode="multiple": the callout is still drawn and the > dataTips are offset. Any ideas? This is kind of a deal-breaker for > my app, since a major feature is to display my custom dataTips > directly adjacent to all (plot) data points at the same time. I > suppose I could go way-deep into concatenating the default > itemRenderer and the dataTip's custom contents into a custom > itemRenderer, but I'd rather not have to code all that internal > plumbing if I could instead do it all with this one style setting. > > Thanks for any suggestions! > > -Peter Demling > Lexington, MA >
<<image001.jpg>>
<<image002.jpg>>

