T O P I C R E V I E W |
Tagge2001 |
Posted - 08/28/2009 : 7:03:04 PM 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 |
3 L A T E S T R E P L I E S (Newest First) |
Tagge2001 |
Posted - 08/31/2009 : 6:09:27 PM 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 |
greg |
Posted - 08/31/2009 : 11:33:02 AM 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. |
larry_lan |
Posted - 08/31/2009 : 03:43:45 AM 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 |