DataRange::SetPlotUID

Description

Set dataplot's uid by index.

Syntax

void SetPlotUID( UINT uid, int nINdex = -1 )

Parameters

uid
[input]the uid to be set.
nINdex
[input]the index of the data. DataRange can reference multiple sets of data. Index starts from 0.

Return

Examples

EX1

// This example assumes a worksheet with two columns is active.
// Set the datarange's plot UID then output the plot UID.
void DataRange_SetPlotUID_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if( !wks )
        return;
 
    DataRange dr;
    dr.Add("Range1", wks, 0, 0, -1, 0);
    dr.Add("Range2", wks, 0, 1, -1, 1);
    
    dr.SetPlotUID(10, 0);//set Range1's plot UID.
    dr.SetPlotUID(20, 1);//set Range2's plot UID.
    
    vector<uint> vUID;
    dr.GetPlots(vUID);//Get the datarange's plot UID.
    for (int ii = 0; ii < vUID.GetSize(); ii++)
        printf("UID%d = %d\n", ii + 1, vUID[ii]);
}

Remark

See Also

header to Include

origin.h