Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

ObjectAtPointer – PB Docs 125 – PowerBuilder Library

ObjectAtPointer – PB Docs 125

ObjectAtPointer PowerScript function

Description

Finds out where the user clicked in a graph. ObjectAtPointer reports
the region of the graph under the pointer and stores the associated
series and data point numbers in the designated variables.

Controls

Graph controls in windows and user objects, and graphs in
DataWindow controls

Syntax

Argument

Description

controlname

The name of the graph object for which
you want the object under the pointer, or the DataWindow control
containing the graph

graphcontrol (DataWindow control
only)

(Optional) A string whose value is the
name of the graph in the DataWindow control for which you want the
object under the pointer

seriesnumber

An integer variable in which you want
to store the number of the series under the pointer

datapoint

An integer variable in which you want
to store the number of the data point under the pointer

Return Values

grObjectType. Returns a value of the grObjectType enumerated
datatype if the user clicks anywhere in the graph (including an
empty area) and a null value if the user clicks
outside the graph.

Values of grObjectType and the parts of the graph associated
with them are:

  • TypeCategory! – A
    label for a category

  • TypeCategoryAxis! – The category axis or
    between the category labels

  • TypeCategoryLabel! – The label of the category
    axis

  • TypeData! – A data point or other data
    marker

  • TypeGraph! – Any place within the graph
    control that is not another grObjectType

  • TypeLegend! – Within the legend box, but
    not on a series label

  • TypeSeries! – The line that connects the
    data points of a series when the graph’s type is line or
    on the series label in the legend box

  • TypeSeriesAxis! – The series axis of a
    3D graph

  • TypeSeriesLabel! – The label of the series
    axis of a 3D graph

  • TypeTitle! – The title of the graph

  • TypeValueAxis! – The value axis, including
    on the value labels

  • TypeValueLabel! – The user clicked the
    label of the value axis

Usage

The ObjectAtPointer function allows you
to find out how the user is interacting with the graph. The function
returns a value of the grObjectType enumerated datatype identifying
the part of the graph. When the user clicks in a series, data point,
or category, ObjectAtPointer stores the series
and/or data point numbers in designated variables.

When the user clicks a data point (or other data mark, such
as line or bar), or on the series labels in the legend, ObjectAtPointer stores
the series number in the designated variable.

When the user clicks on a data point or category tickmark
label, ObjectAtPointer stores the data point
number in the designated variable.

When the user clicks in a series, but not on the actual data
point, ObjectAtPointer stores 0 in datapoint and
when the user clicks in a category, ObjectAtPointer stores
0 in seriesnumber. When the user clicks other
parts of the graph, ObjectAtPointer stores 0
in both variables.

note.png Call ObjectAtPointer first

ObjectAtPointer is most effective as the
first function call in the script for the Clicked event for the
graph control. Make sure you enable the graph control (the default
is disabled). Otherwise, the Clicked event script is never run.

Examples

These statements store the series number and data
point number at the pointer location in the graph named gr_product in SeriesNbr and ItemNbr.
If the object type is TypeSeries! they obtain the series name, and
if it is TypeData! they get the data value:

These statements store the series number and data
point number at the pointer location in the graph named gr_computers in
the DataWindow control dw_equipment in SeriesNbr and ItemNbr:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x