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
 LabTalk Forum
 Problem with Graph 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

Skaytex

Lithuania
7 Posts

Posted - 02/09/2014 :  10:12:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello i have this graph:




And i want to change legend with labtalk.

Is it possible to change legend with labtalk scripting B with col(L)[1], c with col(L)[2] and... Or add col(L)[1] to Col(B) long name, col(L)[2] to Col(C) long name and ...


KF

Edited by - Skaytex on 02/09/2014 10:16:54 AM

lkb0221

China
497 Posts

Posted - 02/10/2014 :  09:49:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If you prefer to do this manually (by GUI), you can right click the legend and select "Properties". Replace those %(#) by %(1,@WT,12,#).
This notation reads the col(12) cells. For example:
%(1,@WT,12,1) ==> 0.00155

If you want to finish this by LabTalk, you better copy the legend info to "Comments" column label rows.
//Script Start
loop(ii,1,wks.ncols)
{
wks.col$(ii+1).comment$ = cell(ii,12)$;
}
//Script End

hope this would help.

Zheng
OriginLab
Go to Top of Page

Skaytex

Lithuania
7 Posts

Posted - 02/12/2014 :  12:15:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ty. I have one more problem, how to change graph legend position with labtalk?

KF
Go to Top of Page

lkb0221

China
497 Posts

Posted - 02/12/2014 :  1:14:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The default programming name of legend is "legend" (You can open programming control dialog to change its name).
So to set the position of the legend, you can use the following commands:

legend.x1 = 10; // Set the upper-left corner node X position be 10 based on layer X axis coordinate.
legend.y1 = 10; // Set the upper-left corner node Y position be 10 based on layer Y axis coordinate.
legend.x = 10; // Set the center of legend be 10 based on layer X axis coordinate.
legend.y = 10; // Set the center of legend be 10 based on layer Y axis coordinate.
legend.left = 1000; // Left location of the legend in pixel.
legend.top = 500; // Top location of the legend in pixel.

It's not that easy to position a legend by LabTalk, especially if the legend is out side the layer range, I have to say.

Zheng
OriginLab
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