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
 Origin Forum
 Hidden Graphs

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
gleeblejim Posted - 02/25/2013 : 07:46:43 AM
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
4   L A T E S T    R E P L I E S    (Newest First)
gleeblejim Posted - 02/26/2013 : 3:53:53 PM
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
gleeblejim Posted - 02/25/2013 : 3:20:14 PM
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!
gleeblejim Posted - 02/25/2013 : 12:00:04 PM
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!
Hideo Fujii Posted - 02/25/2013 : 10:42:11 AM
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

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