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
 Origin Forum
 Hidden Graphs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gleeblejim

USA
33 Posts

Posted - 02/25/2013 :  07:46:43 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9.0 and Service Release 0 (Select Help-->About Origin):
Operating System: Win 7 32-bit.

Hello Origin Crew!

I have what I hope is a quick fix. An opx that I work with causes any graphs I make to plot the graph behind the workbook instead of in front of it. Would this be something that can be fixed with the graph template or code?

Thanks!
Gleeblejim

Hideo Fujii

USA
1582 Posts

Posted - 02/25/2013 :  10:42:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Gleeblejim,

I'm not exactly sure what your actual problem is. If "front" you said means "active" window, the following simple script puts all graph windows in front of all workbooks by activating graph windows.
doc -e P {
  win -a %H;
}
Does this work as you wanted to achieve?

--Hideo Fujii
OriginLab
Go to Top of Page

gleeblejim

USA
33 Posts

Posted - 02/25/2013 :  12:00:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes sir. Sorry for using the wrong term. Basically what happens is in my opx the workbook stays the "active" item instead of changing to have the graph be active. I will test this today!

Thanks!
Go to Top of Page

gleeblejim

USA
33 Posts

Posted - 02/25/2013 :  3:20:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hideo,

No such luck. It did give me an idea of where to look though. There is a line in my code:

win -t plot (template name);

I'm hoping if I use a combination of this and:

doc -e P{
win -a %H;
}

I can figure it out.

Thanks!
Go to Top of Page

gleeblejim

USA
33 Posts

Posted - 02/26/2013 :  3:53:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I've had no luck tweaking it on my own. The section of code that deals with making the graph is this below:


[YPlot]
	//section identifier diag
	type "Section Yplot";

	%W=%H;
	// worksheet must be active 
	if (exist(%w)!=2) 
	{	
		return;
	}

	// set time as x 
	%W!wks.col1.type=4;    

	// determine column 
	col=colnum(%W_%1);

	//legacy diag
	// type $(col) %1; 
	
	//if no columns are found, bail
	if (col==0)
	{
		type -b %1 not acquired.;
		return;
	}

	// set y 
	work -t $(col) 1;  //set column $(col) to 1 = "(Y) column"

	// plot 
	//win -t plot line;  //create a new window from the template file, plot = "open a plot window", line = name assigned to window
	win -t plot ggraph;

	layer -i %w_%1;   //add a dataset to the active layer - dataset name = %w_%1

	layer -a;       // -a - rescale the X and Y axes of the active layer to show all the data plotted in that layer
	
	/* copy labels */
	%a=%w!wks.col$(col).label$;
	if (%a!="") 
	{
		//remove 12/09 fix for doubled up labels
		//// axis label fix -> reduce %a by removing 2nd line fetched by archaic .label$ 
		//%a=%[%a,@1]; 
		yl.text$=%a;    /* null string causes GPF */
	}
	else 
	{
		//diag
		type "could not fetch Y axis label";
		label -r YL;
	}

	%a=%w!wks.col1.label$;
	if (%a!="") 
	{
		//remove 12/09 fix for doubled up labels
		//// axis label fix -> reduce %a by removing 2nd line fetched by archaic .label$ 
		//%a=%[%a,@1]; 
		XB.text$=%a;
	}    
	else 
	{
		//diag
		type "could not fetch X axis label";
		label -r XB;
	}

	%a=%w!page.label$;

	//Call Title - note that it destroys the contents of %b
	run.section(,GTitle, "%a");  

	//legend.show=0;          /* hide legend */
	
	//make the window width match the initial graph
	//page.width = 6600;

	// rename the plot window to the items graphed 
	page.label$ = "%1 vs. Time";

	return 0;


Using your suggestion I wasn't able to make the graphs the Active Item. this is a project I've taken over form someone else so I'm still learning the code.

Thank you,
gleeblejim
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