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
 Forum for Origin C
 Read displayed graph legend text
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hofmaale

20 Posts

Posted - 07/13/2017 :  05:43:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,

is there a possibility to get the processed and displayed legend text?

So far I know to different options:
a) iterate through all DataPlots and execute the GetLegend() command. This will print a list of possible, standard legend texts, but for all plots - not only those actually appearing in the legend
b) search for the Legend object by iterating over all GraphObjects in the active layer. In this case, one can get the unsubstituted legend text

What I'm searching for is some fictonal option c) to read the displayed legend text, i.e. the actual contents of the legend-object but after legend-text substitution is done.

Is there a way to accomplish this?

Thank you very much in advance,

Alex


Origin Ver. and Service Release (Select Help-->About Origin): 2017G SR1
Operating System: Win 7 x64

cpyang

USA
1406 Posts

Posted - 07/13/2017 :  11:00:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Are you trying to get the column longname or comments from a plot?

From LabTalk, you can get the actual legend display text by simply

string str$ = "%(1)";
str.=


but to get anything else from the plot (by index, 1,2,3), you can read this

http://originlab.com/doc/LabTalk/ref/Legend-Substitution-Notation#List_of_.40Options

CP
Go to Top of Page

Castiel

343 Posts

Posted - 07/14/2017 :  01:51:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by hofmaale

Dear all,

is there a possibility to get the processed and displayed legend text?

So far I know to different options:
a) iterate through all DataPlots and execute the GetLegend() command. This will print a list of possible, standard legend texts, but for all plots - not only those actually appearing in the legend
b) search for the Legend object by iterating over all GraphObjects in the active layer. In this case, one can get the unsubstituted legend text

What I'm searching for is some fictonal option c) to read the displayed legend text, i.e. the actual contents of the legend-object but after legend-text substitution is done.

Is there a way to accomplish this?

Thank you very much in advance,

Alex


Origin Ver. and Service Release (Select Help-->About Origin): 2017G SR1
Operating System: Win 7 x64



OC_API int okutil_arg_copy(string* pstr, LPCSTR lpcszPageLayerContext=NULL, USHORT cntrl=0);



     #####
    #### _\_  ________
    ##=-[.].]| \      
    #(    _\ |  |------|
     #   __| |  ||||||||
      \  _/  |  ||||||||
   .--'--'-. |  | ____ |
  / __      `|__|[o__o]|
_(____nm_______ /____\____ 
Go to Top of Page

hofmaale

20 Posts

Posted - 07/19/2017 :  03:49:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

Are you trying to get the column longname or comments from a plot?


Nope.

quote:
Originally posted by Castiel

[...]
okutil_arg_copy
[...]


Thanks - that was what I was looking for!
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