2.2.4.8.21 DataPlot::GetRelatedDatasetNames


Description

Get related dataset names array

Syntax

int GetRelatedDatasetNames( vector<string> & arrNames )

Parameters

arrNames
[output] related dataset names array

Return

the related dataset names array size;

Examples

EX1

//assume there is a "[Book1]Sheet1" WorkSheet
//and a graph plot active
void     DataPlot_GetRelatedDatasetNames_Ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    if( gl )
    {
        DataPlot dp = gl.DataPlots();
        Worksheet wks("[Book1]Sheet1");
        DatasetObject dsObject1 = wks.Columns(0);
        DatasetObject dsObject2 = wks.Columns(1);
        if( dp && dsObject1 && dsObject2)
        {
            string strDataset1 = "RelatedDataset1";
            string strDataset2 = "RelatedDataset2";
            int nRet = dp.SetRelatedDataset(strDataset1, dsObject1);
            nRet = dp.SetRelatedDataset(strDataset2, dsObject2);
            
            vector<string> arrNames;
            dp.GetRelatedDatasetNames(arrNames);
            for(int nn = 0; nn < arrNames.GetSize(); nn++)
            {
                printf("GetRelatedDatasetNames index of %d: %s\n", nn, arrNames[nn]);
            }
        }
    }
}

Remark

See Also

DataPlot::SetRelatedDataset

Header to Included

origin.h