Using point and click

Users can click graphs during execution. PowerScript provides a function called ObjectAtPointer that stores information about what was clicked. You can use this function in a number of ways in Clicked scripts. For example, you can provide the user with the ability to point and click on a data value in a graph and see information about the value in a message box. This section shows you how.

Clicked events and graphs

To cause actions when a user clicks a graph, you write a Clicked script for the graph control. The control must be enabled. Otherwise, the Clicked event does not occur.

Using ObjectAtPointer

ObjectAtPointer has the following syntax.

graphName.ObjectAtPointer ( seriesNumber, dataNumber )

You should call ObjectAtPointer in the first statement of a Clicked script.

When called, ObjectAtPointer does three things:

After you have the series and data point numbers, you can use other graph functions to get or provide information. For example, you might want to report to the user the value of the clicked data point.

Example

Assume there is a graph gr_sale in a window. The following script for its Clicked event displays a message box: