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

Tagge2001

4 Posts

Posted - 08/28/2009 :  7:03:04 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8 SR6
Operating System: Win Xp SP3

Hello,

it's me again. I have another question. Is there a way to position legends automatically. So that the legend is on top of the diagramm with a certain distance.

Do I have to use a script for that?

Regards

Tagge

larry_lan

China
Posts

Posted - 08/31/2009 :  03:43:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Tagge:

You can use the Object Edit toolbar. It's somewhat tricky here. How to aligne the legend depends on how you click the objects.

Supposed the is a graph legend and a data plot on the page, follow these steps:



Once you click any alignment button on Object Edit toolbar, say vertical center, the legend, which you click first, will be aligned according to the data plot (second click).

Thanks
Larry
OriginLab Technical Services
Go to Top of Page

greg

USA
1378 Posts

Posted - 08/31/2009 :  11:33:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Larry's solution will only work in Origin 8.1.

You can use script to position the Legend relative to the Layer. The trick is that you must temporarily switch the Layer units to match the Legend and Page. Here is an example that positions the Legend at the top of the layer, flush to the right side of the layer:

temp = LAYER.UNIT; // Save the current Layer units
LAYER.UNIT = 5; // Set to pixels (actually device dots)
Legend.TOP = LAYER.TOP - Legend.HEIGHT; // At Layer top
Legend.LEFT = LAYER.LEFT + LAYER.WIDTH - Legend.WIDTH;
LAYER.UNIT = temp; // Restore Layer units

This must be done AFTER any changes to the Legend text.

Edited by - greg on 08/31/2009 12:26:26 PM
Go to Top of Page

Tagge2001

4 Posts

Posted - 08/31/2009 :  6:09:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

thanks for your answers! That's great.

I have another question. Now that I know how to position the legend, I tried to find something about the borders of the legend. I looked in the LabTalk documentation and found all sorts of stuff but not if there's a way to find out only the width and height of the legend Text + symbols, so that I can set the disctance between text and border automatically. Is that possible.

Regards

Tagge
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