The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Graph Name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nosrak

USA
Posts

Posted - 07/09/2007 :  11:46:33 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System:

Ok so this is probably an easy question but how do I set the name of the graph window? I'm looping over a bunch of columns and making a graph for each one and would like the name of the window to be the name of the column (as opposed to graph1, graph2... etc.)

Mike Buess

USA
3037 Posts

Posted - 07/09/2007 :  12:17:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use Column::GetName to find the column name and PageBase::Rename to rename the graph window...

Worksheet wks = Project.ActiveLayer();
for(int i=1;i<wks.GetNumCols();i++)
{
string strColName = wks.Columns(i).GetName(); // get column name
GraphPage gp;
gp.Create();
gp.Rename(strColName); // rename graph window
Curve cc(wks,0,i);
gp.Layers(0).AddPlot(cc);
gp.Layers(0).Rescale();
}

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000