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
 Maximise GraphPage

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
rpaczkowski Posted - 03/21/2005 : 3:11:19 PM
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System:Win 2000 Pro

I can activate a graphpage using LT_execute("window -a Name");, but the page is not maximised. How can I achieve this using OC?

Additionally, is there a way to add a second x-axis on top of the graph page (For each x-value I have a y-value and a second x-value. I want the second x-values as a secondary x-axis)
Ralph

Edited by - rpaczkowski on 03/21/2005 3:12:58 PM
6   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 03/22/2005 : 11:45:43 AM
Hi Ralph,

Ok, now I understand (I think!) as to what you want...
To do this you need two layers - not possible with just one layer.

I think then the easiest way to do this is as follows:

1> Go to the Origin GUI, start a new graph (which will have one layer)
2> Right-click near the layer icon on top left, and select New Layer->Top X
3> Customize other things that you may want to do (other than scale settings) and save this as a template.

Then, in your OC code, create an instance of the template saved above, and then use code such as this to set the scale of the 2nd layer X axis to arbitrary values:


// Create the graph using the custom template
GraphPage gpg = Project.Pages();
GraphLayer gly0, gly1;
// Point to the first layer and move in data etc as you need to
gly0 = gpg.Layers(0);
//...
//...
// Now point to second layer
gly1 = gpg.Layers(1);
//
// Can get format into tree and dump to see what is available
Tree tr;
tr = gly1.XAxis.Scale;
out_tree(tr);
//
// Set the from, to and increment value as desired
gly1.XAxis.Scale.From.dVal = -100;
gly1.XAxis.Scale.To.dVal = 45;
gly1.XAxis.Scale.Value.dVal = 25;



I am suggesting again to begin with a custom template because that wil l make things easier - otherwise you will need to programmatically add a second layer, position it correctly etc to show only the x axis on top.

Easwar
OriginLab

rpaczkowski Posted - 03/22/2005 : 11:18:13 AM
Easwar,

close call, it certainly creates a second axis, but it is not what I need. My primary x-axis has values from e.g. -50 to 250, while the secondary x-axis values go from e.g. 0 to 6000. There is a linear relationship between these two , but this relationship is different for every graph I have. In another graph, the primary x-values are the same while the secondary go only from 0 to 800. That is why I can't use the programming example where the relationship is set as fixed.

What I need is to use one set of x-values for the primary x-axis and the other set of x-values (which are in the same worksheet, but of course in a different column) for the secondary x-axis.

I hope I am not too unclear about what i need.
easwar Posted - 03/22/2005 : 11:03:41 AM
Hi Ralph,

You can use code such as pasted below:


void show_top_axis()
{
GraphLayer gly = Project.ActiveLayer();
if( !gly ) return;
AxisObject aoX2;
aoX2 = gly.XAxis.AxisObjects(AXISOBJPOS_AXIS_SECOND);
gly.XAxis.AxisObjects(AXISOBJPOS_AXIS_SECOND).TopTicks.Show.nVal = 1;
gly.XAxis.AxisObjects(AXISOBJPOS_LABEL_SECOND).TopLabels.Show.nVal = 1;
gly.GetPage().Refresh(TRUE);
}



See the programming example "Manipulate Graph Axes" under the "Graphing" category on the folloing page for more details:
http://www.originlab.com/index.aspx?s=9&lm=71&pid=268

Another option of course is to create a custom tempalte with these settings already in place, and then create a new instance of that tempalte in your OC code, so you don't have to go thru the process of setting these things individually in code.

Easwar
OriginLab


rpaczkowski Posted - 03/22/2005 : 08:52:04 AM
Easwar,

Thank you for the maximising help. The second x-axis has a linear relationship to the main x-axis. I would just like to show both of them.

Ralph
easwar Posted - 03/21/2005 : 5:12:41 PM
quote:

Additionally, is there a way to add a second x-axis on top of the graph page (For each x-value I have a y-value and a second x-value. I want the second x-values as a secondary x-axis)



Hi Ralph,

What do you mean by "a second x-value"? Do you mean the second axis has some nonlinear relationship to the main x-axis, such as described in this page?
http://www.originlab.com/www/support/resultstech.aspx?ID=1018&language=English

If the above is the case, then you can acheive adding such an axis from OC by issuing LT_execute commands following instructions on the above page.

Easwar
OriginLab



Edited by - easwar on 03/21/2005 5:14:09 PM
easwar Posted - 03/21/2005 : 5:02:55 PM
Hi Ralph,

You don't need to use LT, can use the SetShow method of PageBase.

So, code such as:

void maximize_graph(string strGraphName)
{
GraphPage gpg(strGraphName);
if( !gpg ) return;
gpg.SetShow();
gpg.SetShow(PAGE_MAXIMIZED);
}



The reason I did a SetShow() with no argument first and then followed again with argument set to PAGE_MAXIMIZED is that otherwise if the page is hidden, it does not seem to work...we need to look into that...

Easwar
OriginLab


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