当我将鼠标移到Flex中的图表行时,如何显示信息?

时间:2022-12-04 09:58:34

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.

我正在构建一个简单的Flex应用程序,我想在其中显示折线图,然后当用户将鼠标悬停在一条线上时,在一个小弹出框中显示一些信息。

1 个解决方案

#1


2  

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:

您可以将LineChart的showDataTips属性设置为true。该属性在ChartBase基类中定义,LineChart扩展。有关showDataTips的更多信息,请访问:

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.

您可以通过指定自定义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):

当您将鼠标悬停在构成线的点上时,使用数据提示将为您提供标注。如果您想提供有关该行的信息,您应该将图表与图例耦合以描述该行代表的内容。创建图例就像这样简单(其中lineChart是LineChart的id值):

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

#1


2  

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:

您可以将LineChart的showDataTips属性设置为true。该属性在ChartBase基类中定义,LineChart扩展。有关showDataTips的更多信息,请访问:

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.

您可以通过指定自定义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):

当您将鼠标悬停在构成线的点上时,使用数据提示将为您提供标注。如果您想提供有关该行的信息,您应该将图表与图例耦合以描述该行代表的内容。创建图例就像这样简单(其中lineChart是LineChart的id值):

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