Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
yulisunflower
Posted - 10/28/2009 : 4:23:37 PM 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();
} }
Thanks a lot
Yu
2 L A T E S T R E P L I E S (Newest First)
yulisunflower
Posted - 10/29/2009 : 3:51:31 PM That works! Thanks you very much.
Yu
Iris_Bai
Posted - 10/28/2009 : 9:36:37 PM Hi,
You can use PageBase::Rename(LPCSTR lpcszNewName, BOOL bAskIfAlreadyUsed = FALSE). For example,