GetDataValue
PowerScript function
Description
Obtains the value of a data point in a series in a graph.
Applies to
Graph controls in windows and user objects, and graphs in DataWindow
controls
Syntax
|
1 |
controlname.GetDataValue ( { graphcontrol, } seriesnumber, datapoint, datavariable {, xory } ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph from which you want data, or the |
|
graphcontrol (DataWindow control only) |
(Optional) A string whose value is the name of the graph |
|
seriesnumber |
The number that identifies the series from which you want |
|
datapoint |
The number of the data point for which you want the |
|
datavariable |
The name of a variable that will hold the data value. The |
|
xory (scatter graph only) |
(Optional) A value of the grDataType enumerated datatype
|
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, GetDataValue returns null.
Usage
GetDataValue retrieves data from any graph. The data is stored in
datavariable, whose datatype must match the datatype of the graph’s values
axis. If the values axis is numeric, you can also use the GetData
function.
Examples
These statements obtain the data value of data point 3 in the series
named Costs in the graph gr_computers in the DataWindow control
dw_equipment:
|
1 2 3 4 5 6 7 8 |
integer SeriesNbr, rtn double data_value // Get the number of the series. SeriesNbr = dw_equipment.FindSeries( & "gr_computers", "Costs") rtn = dw_equipment.GetDataValue( & "gr_computers" , SeriesNbr, 3, data_value) |
These statements obtain the data value of the data point under the
mouse pointer in the graph gr_prod_data and store it in data_value. If the
user does not click on a data point, then ItemNbr is set to 0. The
categories of the graph are time values:
|
1 2 3 4 5 6 7 8 9 10 |
integer SeriesNbr, ItemNbr, rtn time data_value grObjectType MouseHit MouseHit = & gr_prod_data.ObjectAtPointer(SeriesNbr, ItemNbr) IF ItemNbr > 0 THEN rtn = gr_prod_data.GetDataValue( & SeriesNbr, ItemNbr, data_value) END IF |
These statements obtain the x value of the data point in the scatter
graph gr_sales_yr and store it in data_value. If the user does not click
on a data point, then ItemNbr is set to 0. The datatype of the category
axis is Date:
|
1 2 3 4 5 6 7 8 |
integer SeriesNbr, ItemNbr, rtn date data_value gr_product_data.ObjectAtPointer(SeriesNbr, ItemNbr) IF ItemNbr > 0 THEN rtn = gr_sales_yr.GetDataValue( & SeriesNbr, ItemNbr, data_value, xValue!) END IF |
See also