Origin 7.5 sr6 Operating System:Windows Vista I wrote a small program to plot the fitting results of my data, I would like to name each graph by the column name of the data plotted instead of Graph1, Graph2 and so on. Any idea how to do that? My code is like this:
wksData = Project.ActiveLayer();// get the active layer, which is the fitted worksheet
for (iColNum=1;iColNum<=ncol;iColNum++) { // *** Use Worksheet class Columns collection to get second column and check column name *** //col = wksData.Columns(iColNum); // Get second column in worksheet (0 based index) //strColName = col.GetName(); // Get column name to check (just for fun)
//creat a graph GraphPage grphData; bool bRetG = grphData.Create("PCH2"); // use the "PCH2" template for graph
// Point to active layer in current graph page GraphLayer grphLayer = grphData.Layers();
// Declare a curve object using x,y columns of worksheet Curve crvData(wksData, 0, iColNum); Curve crvFit(wksData,0,iColNum+ncol*2);
// Plot data curve to active layer int nPlot = grphLayer.AddPlot(crvData, IDM_PLOT_LINESYMB); int mplot = grphLayer.AddPlot(crvFit, IDM_PLOT_SCATTER); grphLayer.Rescale();