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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Right axis title

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
wuender2 Posted - 10/19/2009 : 03:47:26 AM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8 SR1
Operating System: WinXP Pro Versin 2003, SP3

In my code I append several layers to a GraphPage and try to label the right axis of the layers:


Tree MyTree, MyTreeDebug;

MyTree.Root.Axes.Y.Scale.From.dVal = 3.1415; // Just a check

MyTree.Root.Axes.Y.Ticks.LeftTicks.show.nVal = 1;
MyTree.Root.Axes.Y.Ticks.LeftTicks.Major.nVal = 1;
MyTree.Root.Axes.Y.Ticks.LeftTicks.Minor.nVal = 1;
MyTree.Root.Axes.Y.Titles.LeftTitle.show.nVal = 1;
MyTree.Root.Axes.Y.Titles.LeftTitle.AddNode("Text").strVal = "TextLeft";

MyTree.Root.Axes.Y.Ticks.RightTicks.show.nVal = 1;
MyTree.Root.Axes.Y.Ticks.RightTicks.Major.nVal = 1;
MyTree.Root.Axes.Y.Ticks.RightTicks.Minor.nVal = 1;
MyTree.Root.Axes.Y.Titles.RightTitle.show.nVal = 1;
MyTree.Root.Axes.Y.Titles.RightTitle.AddNode("Text").strVal = "TextRight";

printf ("Before applying changed properties:\n");
MyTreeDebug = MyGp->Layers(3).GetFormat(FPB_ALL, FOB_ALL);
out_tree(MyTreeDebug);

MyGp->Layers(3).UpdateThemeIDs(MyTree.Root);
MyGp->Layers(3).ApplyFormat(MyTree, true, true, true);

printf ("\nAfter applying changed properties:\n");
MyTreeDebug = MyGp->Layers(3).GetFormat(FPB_ALL, FOB_ALL);
out_tree(MyTreeDebug);


I succeed in changing all other properties of the layer but the title of the right axis remains unchanged. Only the left axis title is set in the Titles/All branch as can be seen in the output of the code:


Before applying changed properties:
OriginStorage
Root
Page
Layers
All
[snip]
Axes
[snip]
Y
[snip]
Titles
All
Background
Dimension
Left = 5.8000000000000007
Top = 25.
Right = 5.6000000000000005
Bottom = 24.800000000000001
Angle = 90.
Text = %(?Y)
[snip]

After applying changed properties:
OriginStorage
Root
Page
Layers
All
[snip]
Axes
[snip]
Y
[snip]
Titles
All
Background
Dimension
Left = 5.8000000000000007
Top = 25.
Right = 5.6000000000000005
Bottom = 24.800000000000001
Angle = 90.
Text = TextLeft
[snip]


Any assistance is greatly appreciated.

With best regards,
Dirk
2   L A T E S T    R E P L I E S    (Newest First)
wuender2 Posted - 10/23/2009 : 12:11:18 PM
Hi Iris,

thanks a lot!

with best regards,
Dirk
Iris_Bai Posted - 10/22/2009 : 10:47:29 PM
Hi Dirk,


Please try the following function. I tried to add right axes title by format tree, but failed. Seems this property cannot be created by this way. In Origin8.0, there is not OC function to do this, so I used LT command in below function. But in Origin8.1, add AxisObject::GetTitleObject to AxisObject class to get title object, if not existed, will add firstly.
void testFormatTree()
{
	GraphPage gp;
	gp.Create("Origin");
	GraphLayer gl = gp.Layers(0);
	
	Tree MyTree;	
	MyTree.Root.Axes.Y.Ticks.RightTicks.AddNode("Show").nVal = 1;
	MyTree.Root.Axes.Y.Labels.RightLabels.AddNode("Show").nVal = 1;
	
	int nn = gl.UpdateThemeIDs(MyTree.Root);
	if( 0 == nn )
	{
		if( gl.ApplyFormat(MyTree, true, true, true) )
			out_str("Set format done!!");
	}
	
	// In Origin8.1 you can use:
        /*	
	AxisObject aoYR = gl.YAxis.AxisObjects(AXISOBJPOS_AXIS_SECOND);
	if( aoYR )
	{
		GraphObject	goTitle = aoYR.GetTitleObject("TextRight");		
	}
	*/

	// In Origin8.0, you can use LT to add right axes title.	
	gl.LT_execute("lab -yr TextRight");
	
	// set right axes title Angle to 90 and set link it to variables.
	Tree trCheck;	
	trCheck = gl.GetFormat(FPB_ALL, FOB_ALL, true, true);
	trCheck.Root.Axes.Y.Titles.RightTitle.Angle.nVal = 90;
	trCheck.Root.Axes.Y.Titles.RightTitle.LinkToVars.nVal = 1;
	nn = gl.UpdateThemeIDs(trCheck.Root);
	if( 0 == nn )
	{
		if( gl.ApplyFormat(trCheck, true, true, true) )
			out_str("Set format done!!");
	}	
}


Iris

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000