GetYColumn
To get Y column of XYRange
BOOL GetYColumn( Column & col, int nIndex = 0, int* pr1 = NULL, int* pr2 = NULL)
TRUE if success.
EX1
There are times when you will want to know where the data for a plot is located. The following example shows how to get the workbook and worksheet names for the Y data in the active graph.
//Output the active graphlayer's source workbook name and worksheet name. void XYRange_GetYColumn_Ex1() { GraphLayer gl = Project.ActiveLayer(); if( gl ) { DataPlot dp = gl.DataPlots(0); // 0 = first plot if( dp ) { XYRange xyr; if( dp.GetDataRange(xyr) ) { Column col; if( xyr.GetYColumn(col, 0) ) // 0 = first Y data { Worksheet wks; col.GetParent(wks); if( wks ) { WorksheetPage wp; wks.GetParent(wp); if( wp ) { printf("Workbook = %s\n", wp.GetName()); printf("Worksheet = %s\n", wks.GetName()); } } } } } } }
XYRange::GetXColumn, XYRange::GetErrColumn
origin.h