T O P I C R E V I E W |
datrix |
Posted - 07/15/2009 : 7:20:14 PM Hello, itīs 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 |
2 L A T E S T R E P L I E S (Newest First) |
datrix |
Posted - 07/16/2009 : 05:35:20 AM Exactly, what Iīve been looking for. Works like a charm. ;)
Thanks from Germany. datrix
|
cpyang |
Posted - 07/15/2009 : 9:13:46 PM 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
|
|
|