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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 legend

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ovince Posted - 10/22/2006 : 2:16:42 PM
hi All

I have a problem to make a legend. I have vectors of float and I could not manage to put these numbers
into the legend. I did this

LT_set_var("A", vecfL[4]);
LT_set_var("B", vecfL[3]);
LT_execute("lab -r Legend;");
LT_execute("legend -s;");
LT_execute("type $(A);");
LT_execute("type $(B);");
LT_execute("legend.text$='\l(1) $(A)
\l(2) $(B)';");


what I do wrong?

Thanks
oliver

2   L A T E S T    R E P L I E S    (Newest First)
ovince Posted - 10/22/2006 : 4:11:26 PM


thanks many rlewis
rlewis Posted - 10/22/2006 : 3:55:31 PM
How about the following approach ...
 
bool Update_Legend(vector<string> strLegend)
{
GraphLayer gL=Project.ActiveLayer();
if(gL.IsValid()==false)
{
return (false);
}
LT_execute("Legend");
GraphObject goLegend;
goLegend=gL.GraphObjects("Legend");
if(goLegend.IsValid()==false)
{
return (false);
}
goLegend.Text="";
int NumLines=strLegend.GetSize();
for (int i=0;i<NumLines;i++)
{
goLegend.Text+=strLegend[i];
if(i<NumLines-1)
{
goLegend.Text+="\r\n";
}
}
return (true);
}

bool vector_To_Legend()
{
vector<string> strLegend;
vector<float>vctArray={1.1,2.2,3.3,4.4};
int ArraySize=vctArray.GetSize();
strLegend.SetSize(ArraySize);
string strText;
for(int i=0; i<ArraySize;i++)
{
strText.Format("%f",vctArray[i]);
strLegend[i]=strText;
}
if(Update_Legend(strLegend)==true)
{
return (true);
}
return (false);
}


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000