DataPlot::GetDataPoint

Contents

Description

Given DataPlot data index and get corresponding data point values.

Syntax

BOOL GetDataPoint( int nIndex, double * pX, double * pY, double * pZ = NULL, double * pErr = NULL, DWORD dwCntrl = 0 )

Parameters

nIndex
[input] 0 offset index to the data in the data plot.
pX
[output] if not NULL, to receive the X value at the given index.
pY
[output] if not NULL, to receive the Y value at the given index.
pZ
[output] if not NULL, to receive the Z value at the given index if DataPlot has Z values, or NANUM.
pErr
[output] if not NULL, to receive the Y Error Bar value the given index if Y error bar is present, or NANUM.
dwCntrl
[input] to control the internal deails.

Return

FALSE if nIndex is < 0 or outside the Data Plot range, TRUE if nIndex is inside the Data

Plot range.

Examples

//Get the first datapoint value.
void DataPlot_GetDataPoint_Ex1()
{
        GraphLayer gl = Project.ActiveLayer();
        if ( gl )
        {
                DataPlot dp = gl.DataPlots(0); //get the first dataplot on graphlayer
                if ( dp )
                {
                        double dX, dY;
                        dp.GetDataPoint(0, &dX, &dY);
                        printf("The first point in active dataplot is (%lf, %lf):", dX, dY);
                }
        }
        
}

Remark

See Also

DataPlot::GetDataPoints

header to Include

origin.h