views:

1181

answers:

1

I'm building a simple Flex applicaton where I want to show a line chart, then display some information in a little popup box when user mouses over a line.

+2  A: 

You can set the showDataTips property of the LineChart to true. The property is defined in the ChartBase base class, which LineChart extends. More information about showDataTips is here:

http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/ChartBase.html#showDataTips

You can customize what is displayed in the data tip callout by specifying a custom dataTipFunction.

Using data tips will give you call outs as you mouse over the points that make up the line. If you want to provide information about the line in general you should couple the chart with a Legend to describe what the line represents. Creating a legend is as simple as this (where lineChart is the id value of your LineChart):

<mx:Legend dataProvider="{lineChart}" />

darronschall