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
 Graph questions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nbo10

USA
Posts

Posted - 12/16/2005 :  8:23:30 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System:xp

A few quick questions.

1) how do I set the text on the axis labels?
2) how do I make a new legend, change the font size,and change it's position?
3) with export_page_to_image(...) what are the file format options, bmp and what else? eps, wmf???

Thanks

easwar

USA
1965 Posts

Posted - 12/17/2005 :  3:51:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

First of all, I would suggest that you look into using graph templates and graph themes which may be easier to work with rather than building graph programmatically from scratch. You can customize a graph and save as template and create instance of it programmatically, or save your desired settings to a template file and applly template programmatically to other graphs.

As for your specific questions:
1) Please see the following page and the example named "Manipulate graph axes" under graphing category
http://www.originlab.com/index.aspx?s=9&lm=71&pid=268

2)The legend is a text object with name "Legend" and properties of this text object can be accessed with code such as:


GraphLayer gly = Project.ActiveLayer();
if( !gly ) return;

// Add/update legend
LT_execute("Legend;");
// Point to legend text object
GraphObject gobjLegend = gly.GraphObjects("Legend");
// Get dimension properties into tree and change
Tree tr;
tr = gobjLegend.Label.Dimension;
out_tree(tr);
tr.Dimension.Left.dVal = 5.5;
gobjLegend.Label.Dimension = tr;
// Can also directly address object properties
gobjLegend.Label.Font.Size.nVal = 28;



3) All formats supported in the GUI are allowed. As to what string constant to use for each format, please look at the export dialog and the Save as Type drop-down. For example to export as a TIFF file, you will use:
export_page_to_image( pg, "c:\\test.tiff", "tif", false);

Easwar
OriginLab




Edited by - easwar on 12/17/2005 3:52:05 PM
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