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
 How do I access the custom tick labels tab?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Shemini

USA
11 Posts

Posted - 06/08/2010 :  5:18:29 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have been trying to write code that will make the tick labels have no decimal places only at the point 0. This can be done in the Axis dialog using the custom tick labels tab but I need to access this tab through code. on the wiki it has an example but I tried testing that example and it didn't work for me.

Please advise...
Thank you

Shemini

USA
11 Posts

Posted - 06/08/2010 :  5:29:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
P.S. I am using version 8.0
Go to Top of Page

Penn

China
644 Posts

Posted - 06/08/2010 :  10:45:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

To access the format tree of axis you want, you can get the format tree and output this format tree after setting in GUI. In your issue, you can done in the Axis dialog using the Custom Tick Labels tab, and then run the following code.

void accessSpecialLabel()
{
	GraphLayer gl = Project.ActiveLayer();
	if(!gl)
		return;
	
	Axis aX = gl.XAxis;
	if(!aX)
		return;
	
	Tree trFormat;
	// need to change the Special setting to get the corresponding tree node
	trFormat = aX.GetFormat(FPB_ALL, FOB_ALL, TRUE, TRUE);  // get the tree format of X axis
	out_tree(trFormat);  // output tree format, then can see the tree node you want
	
	// set the tree node value you want
	trFormat.Root.Labels.BottomLabels.Custom.Special.Type.nVal = 3;  // set to Manual
	trFormat.Root.Labels.BottomLabels.Custom.Special.Label.nVal = 0;  // set label to 0, no decimal place
	trFormat.Root.Labels.BottomLabels.Custom.Special.Value.dVal = 0.0;  // value point to set
	
	int nErr = aX.UpdateThemeIDs(trFormat.Root);
	if(0!=nErr)
		out_str("Error");
	
	aX.ApplyFormat(trFormat, true, true, true);  // apply format to X axis
}

This page has provided some examples about how to access graph format with theme tree and they may be helpful.

Penn
Go to Top of Page

Shemini

USA
11 Posts

Posted - 06/09/2010 :  09:55:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Penn,

Thank you very much for your help. When I try this code it gives an error from

aX.UpdateThemeIDs(trFormat.Root);

Maybe there is something I am missing. When it prints the tree there is no TreeNode called Custom or Special under the BottomLabels Node. I am not very good yet with using Trees, and so far I have not been able to make a node that was not there previously without errors. Any further help would be greatly appreciated.

Thank you
Go to Top of Page

Penn

China
644 Posts

Posted - 06/09/2010 :  10:39:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am afraid that you are not using Origin 8 SR6. You can update to SR6 from this page and have a try again.

Penn
Go to Top of Page

Shemini

USA
11 Posts

Posted - 06/10/2010 :  11:54:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Penn,

Yes, that did fix it. Thank you very much.

Shemini
Go to Top of Page

mulisa

2 Posts

Posted - 06/20/2010 :  02:17:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Here you can find what do you want
http://www.brideswardrobe.com/prices-drop.php
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