Gets the value of a data point in a series in a graph when the values axis has numeric values.
For handling all datatypes and for getting values in the DataWindow Web ActiveX, see GetDataValue.
PowerBuilder DataWindow DataWindow control
double dwcontrol.GetData ( string graphcontrol, integer seriesnumber, long datapoint , { grDataType datatype } )
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control containing the graph. |
graphcontrol |
A string whose value is the name of the graph in the DataWindow control. |
seriesnumber |
The number that identifies the series from which you want data. |
datapoint |
The number of the data point for which you want the value. |
datatype (scatter graph only) (optional) |
A value of the grDataType enumerated datatype (in PowerBuilder) specifying whether you want the x or y value of the data point in a scatter graph. Values are:
For more information, see grDataType. |
Returns the value of the data in datapoint if it succeeds, 0 if the series does not exist, and -1 if an error occurs. If any argument’s value is null, GetData returns null.
You can use GetData only for graphs whose values axis is numeric. For graphs with other types of values axes, use the GetDataValue method instead.
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:
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 x value of the data point in the scatter graph gr_sales_yr in the DataWindow dw_sales and store it in data_value:
integer SeriesNbr, ItemNbr
double data_value
dw_sales.ObjectAtPointer("gr_sales_yr", SeriesNbr, &
ItemNbr)
data_value = dw_sales.GetData("gr_sales_yr", &
SeriesNbr, ItemNbr, xValue!)