Hi Tony,
GraphLayer::AddPlot will add one column or the entire worksheet to a graph layer. See the examples for usage. The following function will average all Y columns in the active worksheet...
void average_all_Y_columns()
{
Worksheet wks = Project.ActiveLayer();
int nCols,iCol = wks.AddCol();
Dataset dsX(wks,0);
Dataset dsY(wks,iCol);
dsY.SetSize(dsX.GetSize());
dsY = 0;
for(int i=0;i<iCol;i++)
{
if( OKDATAOBJ_DESIGNATION_Y == wks.Columns(i).GetType() )
{
Dataset ds(wks,i);
dsY += ds;
nCols++;
}
}
dsY /= nCols;
}
Mike Buess
Origin WebRing Member