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
 How to add the comments in the graph?

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
liujibao Posted - 02/15/2004 : 09:09:12 AM
Before exporting to BMP file, I want to add some comments in the curve graph, how to realize it in origin c? and can I modify its position?

Thanks!
4   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 05/09/2008 : 12:07:36 PM
With a small modification, namely
sCmd.Format("label -s -sa -a %f %f %s",dX,dY,sText);
you can use escape sequences to interpret some of those problematic characters (-sa), and pass along substituted strings and variables (-s) as in:
AddLabel("pi \x3D $(pi) \x5BProject : %G\x5D", 5, 1);
which yields the label
pi = 3.14159 [Project : UNTITLED]


Dominik Paulkowski Posted - 05/08/2008 : 07:15:28 AM
Hello everybody!

AddLabel is a very useful function to add label text to a graph. I use it very often. But there are at least two limitations at the ".Format" command. I recommend a piecewise merging like that:

void AddLabel(GraphLayer gl, string sText, double dX, double dY)
{

//GraphLayer gl = Project.ActiveLayer();

string sCmd;

//sCmd.Format("label -a %f %f %s",dX,dY,sText);
// .Format shorten the dX and dY in the string to six decimal digits
// .Format cannot handle equal sign "=" in string -> cause error at execution (without error message)
// Better use adding piecewise:
sCmd = "label -a " + dX + " " + dY + " " + sText;

gl.LT_execute(sCmd);


} // End of AddLabel

Thank you again for the nice funtion, Mike. :-)

-------------------
:-Dipl.-Phys. Dominik Paulkowski
Fraunhofer Institute for Surface Engineering and Thin Films (IST)
Braunschweig
Germany
liujibao Posted - 02/15/2004 : 11:32:23 PM
Thanks!

Edited by - liujibao on 02/15/2004 11:56:57 PM
Mike Buess Posted - 02/15/2004 : 10:33:37 AM
This adds a label with the text sText to the active layer at the coordinates dX and dY....
void AddLabel(string sText, double dX, double dY)
{
GraphLayer gl = Project.ActiveLayer();
string sCmd;
sCmd.Format("label -a %f %f %s",dX,dY,sText);
gl.LT_execute(sCmd);
}


Mike Buess
Origin WebRing Member

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