Syntax 1 For data points in graphs
Description
Gets the value of a data point in a series in a graph.
Controls
Graph controls in windows and user objects, and in DataWindow
controls
Syntax
|
1 |
<span>controlname</span>.<span>GetData</span> ( { <span>graphcontrol</span>, } <span>seriesnumber</span>, <span>datapoint</span> <br> {, <span>datatype</span> } ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph from which you |
|
graphcontrol (DataWindow control |
(Optional) A string whose value is the |
|
seriesnumber |
The number identifying the series from |
|
datapoint |
The number of the data point for which |
|
datatype |
(Optional) A value of the grDataType
|
Return Values
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 |
integer SeriesNbr |
|
1 |
double data_value |
|
1 |
// Get the number of the series. |
|
1 |
SeriesNbr = & |
|
1 |
dw_equipment.FindSeries("gr_computers", "Costs") |
|
1 |
data_value = dw_equipment.<span>GetData</span>( & |
|
1 |
"gr_computers" <span>,</span> 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 |
integer SeriesNbr, ItemNbr |
|
1 |
double data_value |
|
1 |
grObjectType MouseHit |
|
1 |
|
1 |
MouseHit = & |
|
1 |
gr_prod_data.ObjectAtPointer(SeriesNbr, ItemNbr) |
|
1 |
IF MouseHit = TypeSeries! THEN |
|
1 |
data_value = & |
|
1 |
gr_prod_data.<span>GetData</span>(SeriesNbr, ItemNbr) |
|
1 |
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 |
integer SeriesNbr, ItemNbr |
|
1 |
double data_value |
|
1 |
gr_product_data.ObjectAtPointer(SeriesNbr, ItemNbr) |
|
1 |
data_value = & |
|
1 |
gr_sales_yr.<span>GetData</span>(SeriesNbr, ItemNbr, xValue!) |