GraphLayer::DataplotsGrouping

Description

Set/Get dataplots grouping status.

Syntax

int DataplotsGrouping( vector<int> &vn, BOOL bSet = TRUE )

Parameters

vn
[Modify]The array of grouping status for data plots, values can be
enum
{
        DPGP_NOT_GROUPED                        = 0,
        DPGP_head_OF_GROUP,
        DPGP_NOT_head_IN_GROUP
};
bSet
[Input]TRUE to set data plots grouping status, FALSE to get.

Return

Error code enumerate as

enum
{
        GPGPERR_INVALID_DATAPLOT                                                                = -100,
        GPGPERR_MISMATCH_PLOT_TYPE_AND_GROUP_TYPE,
        GPGPERR_GROUP_MUST_HAVE_AT_LEAST_TWO_MEMBERS,
        GPGPERR_GROUP_MUST_HAVE_ONE_head,
        GPGPERR_ALL_PLOTS_IN_ONE_GROUP_MUST_HAVE_SAME_PLOT_TYPE,

        GPGPERR_NO_ERROR                        = 0,
};

Only GPGPERR_NO_ERROR will be returned for Get.

Examples

//Get the number of groups in the active graph layer.
void GraphLayer_DataplotsGrouping_Ex1()
{
    GraphLayer  gl = Project.ActiveLayer();
    vector<int> vn;
    gl.DataplotsGrouping(vn, FALSE);
    //TRUE to set data plots grouping status, FALSE to get. 
    vector<uint>    vnGroupheads;
    vn.Find(vnGroupheads, DPGP_head_OF_GROUP);
    
    printf("There are %d Group(s) in current GraphLayer\n", vnGroupheads.GetSize());
}

Remark

See Also

UngroupPlots, GroupPlots, Groups

header to Include

origin.h