Author |
Topic  |
|
Skaytex
Lithuania
7 Posts |
Posted - 02/09/2014 : 10:12:03 AM
|
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
|
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 |
 |
|
Skaytex
Lithuania
7 Posts |
Posted - 02/12/2014 : 12:15:17 PM
|
Ty. I have one more problem, how to change graph legend position with labtalk?
KF |
 |
|
lkb0221
China
497 Posts |
Posted - 02/12/2014 : 1:14:06 PM
|
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 |
 |
|
|
Topic  |
|
|
|