Syntax 1: For data points in graphs
Description
Gets the value of a data point in a series in a graph.
Applies to
Graph controls in windows and user objects, and in DataWindow
controls
Syntax
|
1 |
controlname.GetData ( { graphcontrol, } seriesnumber, datapoint {, datatype } ) |
|
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 identifying the series from which you want |
|
datapoint |
The number of the data point for which you want the |
|
datatype (scatter graph only) |
(Optional) A value of the grDataType enumerated datatype
|
Return value
Double.
Returns the value of the data in datapoint if it succeeds and 0 if
an error occurs. If any argument’s value is null, GetData returns
null.
Usage
You can use GetData only for graphs whose values axis is numeric.
For graphs with other types of values axes, use the GetDataValue
function instead.
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 |
integer SeriesNbr double data_value // Get the number of the series. SeriesNbr = & dw_equipment.FindSeries("gr_computers", "Costs") data_value = dw_equipment.GetData( & "gr_computers" , SeriesNbr, 3) |
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:
|
1 2 3 4 5 6 7 8 9 10 |
integer SeriesNbr, ItemNbr double data_value grObjectType MouseHit MouseHit = & gr_prod_data.ObjectAtPointer(SeriesNbr, ItemNbr) IF MouseHit = TypeSeries! THEN data_value = & gr_prod_data.GetData(SeriesNbr, ItemNbr) 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:
|
1 2 3 4 5 |
integer SeriesNbr, ItemNbr double data_value gr_product_data.ObjectAtPointer(SeriesNbr, ItemNbr) data_value = & gr_sales_yr.GetData(SeriesNbr, ItemNbr, xValue!) |
See also