GetDataValue

Description

Obtains the value of a data point in a series in a graph.

Applies to

PowerBuilder DataWindow

DataWindow control

Syntax

PowerBuilder

integer dwcontrol.GetDataValue ( string graphcontrol, 
   integer seriesnumber, long datapoint, REF date datavariable 
   {, grDataType XorY } )
integer dwcontrol.GetDataValue ( string graphcontrol, 
   integer seriesnumber, long datapoint, REF datetime datavariable 
   {, grDataType XorY } )
integer dwcontrol.GetDataValue ( string graphcontrol, 
   integer seriesnumber, long datapoint, REF double datavariable 
   {, grDataType XorY } )
integer dwcontrol.GetDataValue ( string graphcontrol, 
   integer seriesnumber, long datapoint, REF string datavariable 
   {, grDataType XorY } )
integer dwcontrol.GetDataValue ( string graphcontrol, 
   integer seriesnumber, long datapoint, REF time datavariable 
   {, grDataType XorY } )

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.

datavariable

The name of a variable that will hold the data value. The variable's datatype can be date, DateTime, double, string, or time. The variable must have the same datatype as the values axis of the graph.

xory (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.

For values, see grDataType.


Return value

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, or returned by a method that corresponds to the axis datatype. If the values axis is numeric, you can also use the GetData function.

Calling GetDataValue when the datatype of datavariable is not the same as the datatype of the data produces undefined results.

If a variable's datatype is non-numeric and the datatype of datavariable is double, GetDataValue returns the number of the datapoint in datavariable.

If a variable's datatype is date, time, or DateTime, GetDataValue returns 1 when the datatype of datavariable is any of those datatypes. However, if the variable's datatype is time and the datatype of datavariable is date, GetDataValue returns 00/00/00 in datavariable, and if the variable's datatype is date and the datatype of datavariable is time, GetDataValue returns 00:00:00 in datavariable.

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:

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)

See also

FindSeries

ObjectAtPointer