2.2.4.8.4 DataPlot::DataPlot

Description

Default constructor which constructs an uninitialized (unattached) DataPlot. The object cannot be used until it is initialized.


Copy constructor which constructs a DataPlot object from another DataPlot object.

Syntax

DataPlot( )


DataPlot( DataPlot & dp )

Parameters

dp
[input]the source DataPlot object.

Return

Examples

EX1

// The example shows how to initialize an uninitialized DataPlot object.
void    DataPlot_DataPlot_ex1()
{
    Worksheet wks;
    wks.Create("origin");
    Dataset ds1(wks,0);
    Dataset ds2(wks,1);
    ds1.Data(1,20,1);
    ds2.Normal(20);

    GraphPage gp;
    gp.Create("origin");

    GraphLayer gl(gp.GetName(), 0);
    gl.AddPlot(wks);

    // Create and attach a graph layer from current Graph:
    gl = Project.ActiveLayer();
    if(gl)
    {
        // Use default constructor to create an uninitialized DataPlot.
        DataPlot        dp;
        
        // Now initialize it to be the first DataPlot in the layer:
        dp = gl.DataPlots(0);
    
        // Displaye a property:
        printf("Data plot range: i2 = %d\n", dp.i2);
    }
}


EX2

void    DataPlot_DataPlot_ex2()
{
    Worksheet wks;
    wks.Create("origin");
    Dataset ds1(wks,0);
    Dataset ds2(wks,1);
    ds1.Data(1,20,1);
    ds2.Normal(20);

    GraphPage gp;
    gp.Create("origin");

    GraphLayer gl(gp.GetName(), 0);
    gl.AddPlot(wks);

    // Create and attach a graph layer from current Graph:
    gl = Project.ActiveLayer();
    if(gl)
    {
        
        // Use copy constructor to create a DataPlot from an existing DataPlot object.
        DataPlot        dp(gl.DataPlots(0));
        
        // Displaye a property:
        printf("Data plot range: i2 = %d\n", dp.i2);
    }
}

Remark

See Also

Header to Include

origin.h