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
 Access to X/Y Lables in GraphLayers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

datrix

11 Posts

Posted - 07/15/2009 :  7:20:14 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,
its me again, with a probably easy question.
Can somebody help me with the right syntax to access the X / Y Labels
in a GraphLayer? I tried the part marked in red and other combinations.

-----------------------

string CreateYLogScaleGraphObject(double x_beg, double x_end, double x_inc, string x_label, double y_beg, double y_end, string y_label){

GraphPage grphData;
grphData.Create("line.otp");
GraphLayer grphLayer = grphData.Layers();
Scale sc;

// X Scaling
sc = grphLayer.X;
sc.From = x_beg;
sc.To = x_end;
sc.Type = LINEAR_SPACE;
sc.Inc = x_inc;

grphLayer.LT_execute("lab -s -xb;", x_label);

// Y Scaling
sc = grphLayer.Y;
sc.From = y_beg;
sc.To = y_end;
sc.Type = LOG10_SPACE;
sc.Inc = 1;

grphLayer.LT_execute("layer.y.minorTicks = 8");

grphLayer.LT_execute("lab -s -yl;", y_label);
return grphData.GetName();

}

-----------------------

Is it possible to access the labels with internal Origin Object Classes instead of LabTalk-Script commands?

Thanks,
datrix

cpyang

USA
1406 Posts

Posted - 07/15/2009 :  9:13:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The names of the XY titles are

XB = X bottom
YL = Y Left
XT = X Top
XR = X Right

You can then just access them by

grphLayer.GraphObjects("YL");

and use the .Text property to access the label, see

http://ocwiki.originlab.com/index.php?title=Category:GraphObject_%28class%29


CP
Go to Top of Page

datrix

11 Posts

Posted - 07/16/2009 :  05:35:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Exactly, what Ive been looking for.
Works like a charm. ;)

Thanks from Germany.
datrix

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