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
 Ticks on axis etc

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
john19858585 Posted - 11/10/2008 : 10:59:39 AM
Hi I'm new to Origin C and was wondering whether it is possible to do any of the following (and if so how):

1). Change the number of minor ticks on the graph axis
2). Create a Title
3). Rename the axis labels
4). Position labels on the sheet.

Many Thanks in Advance

John
1   L A T E S T    R E P L I E S    (Newest First)
Iris_Bai Posted - 11/11/2008 : 8:37:04 PM
Hi,

The example below only for 1), but existed bug, we tracker in #12575.

void testOK1()
{
	GraphLayer gl = Project.ActiveLayer();
	if(!gl)
		return;	

	Tree tr;	
	tr.Root.Page.Layers.All.Axes.X.Scale.MinorTicksCount.nVal = 3; // auto add nodes and assign 3 to MinorTicksCount	
	
	if(0 == gl.UpdateThemeIDs(tr))//0 for no error. ==> Failed here now
	{
		bool bRet = gl.ApplyFormat(tr.Root);
		if(!bRet)
			out_str("Fail to apply");
	}
}


This example for 2) and 3):


//Include grobj_utils.h in order to do 2), this header only support from Origin80. 
#include "grobj_utils.h"

//Note!! before compiling please add grobj_utils.c from OriginC\Originlab directory to workspace
void testOK2()
{
	GraphLayer gl = Project.ActiveLayer();
	if(!gl)
		return;	
	
	// for 2) Create a Title
	GraphObject goNew;
	double x = 35, y = 50;
	string strText = "This is my new title";
	add_text(gl, goNew, x, y, strText);
	
	
	// for 3) do you really want change name? The following codes show how to change label text of Axis
	GraphObject goXL = gl.GraphObjects("XB"); // XB is the label name of X axis, YL is the label name of Y axis
	if(goXL)
	{
		string  str = goXL.Text;
		out_str("Old Label: " + str);
		goXL.Text = "New Label";
	}
	
	gl.GetPage().Refresh(); // to refresh page on changes
}

And could you give more detail about 4)?

Iris

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