check_has_plotted_in_graph

 

Contents

Description

Check the specified DataRange if has been plotted in specified GraphLayer

Syntax

int check_has_plotted_in_graph( const DataRange & dr, const GraphLayer & gl, vector<int> & vnPlotIndices = NULL, DWORD dwNTypeCntrl = NTYPE_BOOKSHEET_XY_RANGE, bool bResetPlotRowRangeIfDiffButNotChecked = false )

Parameters

dr
[input]DataRange to be checked
gl
[input]GraphLayer to be looked into
vnPlotIndices
[output]the plot index for plotted sub data range, -1 for not plotted. it is an optional output.
dwNTypeCntrl
[input] Control for Method GetRangeString to get range string, default is NTYPE_BOOKSHEET_XY_RANGE
bResetPlotRowRangeIfDiffButNotChecked
[input] when true, will continue check if bit is not NTYPE_ADD_ROW_RANGE and set plot range to source range if different,
only used when NTYPE_ADD_ROW_RANGE is NOT specified in dwNTypeCntrl

Return

returns number of plots in dr that has been plotted in gl or return negative for error.

Examples

EX1

void    check_has_plotted_in_graph_ex1()
{
    //make sure and worksheet with at least two columns exists, named as "[Book1]Sheet1"
    //make sure and active graphlayer exists
    GraphLayer gl = Project.ActiveLayer();
    if ( gl )
    {
        string strWksName = "[Book1]Sheet1";
        Worksheet wks(strWksName);
        if ( wks )
        {
            DataRange dr;
            dr.Add(wks, 0, "X");
            dr.Add(wks, 1, "Y");
            int nPlots = check_has_plotted_in_graph(dr, gl);
            out_int("Number of plots in dr that has been plotted : ", nPlots);
        }
    }
}

Remark

See Also

header to Included

origin.h

Reference