XYRange::MakePlot

Description

To make plot with XYRange

Syntax

DataPlot MakePlot( GraphLayer & gl, TreeNode & trPlottingInfo = NULL, int nIndex = 0 )

DataPlot MakePlot( XYRange & rgSrc, TreeNode & trPlottingInfo = NULL, int nIndex = 0 )

Parameters

gl
[input]the graph layer for plot
trPlottingInfo
[input]the infomation for plot
nIndex
[input]the data index

rgSrc
[input]the XYRange for plot
trPlottingInfo
[input]the infomation for plot
nIndex
[input]the data index

Return

DataPlot to be created

Examples

EX1

// This example assumes a worksheet with three columns is the active layer
// Draw a dataplot with the XYRange.
void XYRange_MakePlot_Ex1()
{
    Worksheet wks;
    wks= Project.ActiveLayer();
    XYRange xyData;
    if( wks )
    {
        xyData.Add("X", wks, 0, 0, -1, 0);
        xyData.Add("Y", wks, 0, 1, -1, 1);
        xyData.Add("ED", wks, 0, 2, -1, 2);
        
        GraphPage gp;
        gp.Create();
        GraphLayer gl;
        gl = gp.Layers(0);

        int nIndex = 0;
        DataPlot dp = xyData.MakePlot(gl,NULL, nIndex);
        gl.Rescale();
    }    
}

Remark

See Also

XYRange::GetPlot

header to Include

origin.h