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
 include part of worksheet name in 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

amkr138

Israel
2 Posts

Posted - 11/03/2024 :  09:51:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a group of curves on a graph and I want the legend to display only part of their worksheet name. The name is very long and only let's say the last 10 characters are relevant to the legend. How can it be done? I know how to make the legend display the sheet name but I don't know how I can slice it.

Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2023 (64-bit) 10.0.0.154 (Academic)
Operating System: Windows

ChaoC

USA
174 Posts

Posted - 11/04/2024 :  4:00:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You can process/slice the sheet name during import using LabTalk.

See the example below:



string str1$=%(page.info.system.import.filename$);
str1.trimright(".csv");
string str2$=str1.right(10)$;
wks.userparam(++SlicedSheetName);
col(1)[SlicedSheetName]$=str2$;


Best,
Chao
Go to Top of Page

amkr138

Israel
2 Posts

Posted - 11/07/2024 :  12:12:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much.

Follow up question: If i have multiple worksheets that I import at once with each having its own slicedSheetName, how can i make the legend display that parameter for each work sheet? Currently using the script and the method in the gif above they all display the slicedSheetName from the first worksheet.

Go to Top of Page

ChaoC

USA
174 Posts

Posted - 11/07/2024 :  2:01:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You need to change it to 2X and 3X to refer to the 2nd and 3rd plots in the graph.

E.g.

\l(1) %(1X,@LC)
\l(2) %(2X,@LC)
\l(3) %(3X,@LC)

Best,
Chao
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