Hello flieger,
Please refer to the code below, and check with the execute results.
void GraphLayer_AddPlot()
{
Worksheet wks=Project.ActiveLayer(); // get the active worksheet
for(int i=1;i<5;i++){
DataRange dr;
dr.Add(wks, 0, "X");
dr.Add(wks, i, "Y"); //plot the 1_ith columns as XY scatter
GraphPage gp;
gp.Create("origin");
GraphLayer gl = gp.Layers();
gl.AddPlot(dr, IDM_PLOT_SCATTER);
gl.Rescale();
gp.SetShow();
}
}
Best regards!
Jason
OriginLab Technical Service