I've added a new chart annotation, HorizontalAxisDataSelector, to the FlexLib project.
The HorizontalAxisDataSelector is a relatively simple chart annotation that allows a user to select a value along the horizontal axis of the chart. When the uses mouses down on the chart, the selector dispatches a change event and draws a vertical line at the nearest data point along the x-axis.
The selector contains a dataValues property that is an array containing the y value of each chart series at the given x-axis location. You can use these values to present a clear view to the user of all of the y-values for a given x-value rather than forcing them to rely on mousing over data tip points.
You can view the example here, along with the example source code.
Integrating the chart annotation basically just involves adding the following to your chart:
<mx:annotationElements> <flexlib:HorizontalAxisDataSelector id="dataSelector" change="updateDetails();" selectorColor="0x000000" /> </mx:annotationElements>
This is something I wrote a really long time ago, probably on the order of 6 months or so (6 months is like an eon or two in internet-time). It's nothing special by any means, and is still rough around the edges. I had wanted to re-visit it and make some improvements, but just haven't found the time to work on it. As such, I figured it was best to just publish it since it's actually proven itself useful a few times, rather than hold on to it waiting until I have the time to get around to updating it.
In its current form, you can only use this annotation on horizontal axes that are numeric (or date-driven), and that are in ascending order. Kind of a bummer, I know. If you need to use this on a category axis, feel free to modify the source and contribute it back into FlexLib once you get it working!
Note: Right now this is only available in SVN. Doug and I are still sorting out when the best time is to create new packaged FlexLib .swc releases.
On a related note, this annotation isn't nearly as cool as some of the annotations Ely has come up with. His Chart Sampler is amazing. My meager annotation barely scratches the surface of what is possible in the charting framework. To this day I'm still amazed at just how flexible and extensible the charting framework is...

Leave a comment