2.2.4.8.40 DataPlot::SetRelatedDataset


Description

Set related dataset.

Syntax

int SetRelatedDataset( LPCSTR lpcszName, const DatasetObject & dsObject )

Parameters

lpcszName
[input] related dataset name
dsObject
[input] related dataset

Return

0 if success.

Examples

EX1

//assume there is a "[Book1]Sheet1" WorkSheet
//and a graph plot active
void     DataPlot_SetRelatedDataSet_Ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    if( gl )
    {
        DataPlot dp = gl.DataPlots();
        Worksheet wks("[Book1]Sheet1");
        DatasetObject dsObject = wks.Columns(0);
        if( dp && dsObject)
        {
            string strDataset = "RelatedDataset1";
            int nRet = dp.SetRelatedDataset(strDataset, dsObject);
            
            DatasetObject dsObjectGet;
            BOOL bSuccess = dp.GetRelatedDataset(strDataset, dsObjectGet);
            printf("GetRelatedDataset : %s \n", dsObjectGet.GetName());
        }
    }
}

Remark

See Also

DataPlot::GetRelatedDataset

Header to Included

origin.h