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
 Editing GraphObjects
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

greadey

UK
Posts

Posted - 02/24/2005 :  06:31:34 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi All,

I've found how to verify the existance of various GraphObjects such as XB, Legend etc.

Are there any functions which allow me to edit these objects, e.g. set the x-axis title, update the legend etc?

I also note that for the GraphObjects placed in a default plot there are some funny and not altogether intuitive names such as "_202". These are documented in the graph.h file but is there any other documentation which decribes these objects and their purpose.

Cheers all.

greadey

UK
Posts

Posted - 02/24/2005 :  07:08:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Update,

Dedcided to try the LT_execute method withthe command

label -xb "Current density / mA cm\+(-2)"

Origin C does not like the following;

LT_execute("label -xb"Current density / mA cm\+(-2)"");

so I tried this;

string LTstr;

LTstr = "Current density / mA cm\+(-2)";

LTstr = "label -xb" + LTstr;

LT_execute(LTstr);

The above compiled and my program got right to the end, but instead of my X axis title being replaced (As was my intention) I got the following x axis label;

density / mA cm2
X Axis Title

(the 2 was superscripted)

So, not only was my title not replaced, I also lost the first part of my new title.

Any ideas?



Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/24/2005 :  07:46:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Not sure why your label command isn't working although I see a couple mistakes or typos in your examples. However, once you've declared XB as a GraphObject then simply XB.Text will work...

GraphLayer gl = Project.ActiveLayer();
GraphObject xb;
xb = gl.GraphObjects("XB");
if( xb.IsValid() )
{
xb.Text = "Current density / mA cm\\+(-2)";
}

(You need to double the character \ when it occurs which is why your superscript didn't work. Recall all Origin C paths you've seen.)

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/24/2005 07:48:42 AM
Go to Top of Page

greadey

UK
Posts

Posted - 02/24/2005 :  12:28:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Luverly Jubberly Mike, thanks.

It works a treat now.

Gav.
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