Layer::InsertGraph

 

Description

Add GraphPageBase as a GraphObject to Graph/Worksheet/Matrix.

Syntax

GraphObject InsertGraph( GraphPageBase & gp, LPCSTR lpcszName = NULL, DWORD dwCntrl = 0 )

Parameters

gp
[input] the GraphPageBase to insert
lpcszName
[input] default: NULL, specify the GraphObject name
dwCntrl
[input] default: 0, it's userless for now

Return

GraphObject inserted from the GraphPageBase

Examples

EX1

void Layer_InsertGraph_ex1()
{
    // Create a layer object and attach it to currently active layer
    Layer ly = Project.ActiveLayer();
    if( !ly.IsValid() )
        return;
    
    GraphPage page;
    page.Create("Origin");

    GraphObject go = ly.InsertGraph(page, "name", 0);
    if( go.IsValid() )
    {
        out_str( "GraphObject is valid" );
    }
    else
    {
        out_str( "GraphObject is not valid" );
    }
}

Remark

See Also

Layer::InsertWks

header to Included

origin.h