Author |
Topic |
|
hkkim
Republic of Korea
35 Posts |
Posted - 12/27/2012 : 01:14:47 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.1 SR3 Operating System: Windows XP
Hello! I want to display a graph symbol, an absolute path and a comments field as a graph legend. Here is my command. But the only longname was displayed as a result. How can I fix it? Thanks in advance!
legendupdate update:=0 legend:=0 mode:=7 custom:="\l(1) %(1, @R) %(1X, @LC)";
hkkim |
|
JacquelineHe
287 Posts |
|
hkkim
Republic of Korea
35 Posts |
Posted - 01/04/2013 : 01:31:14 AM
|
Dear Jacqueline,
I want to display comment fields up to 4 on a graph. The GObject was used to reduce a font size. Below is a part of my code. But the only last label is showed. How could I fix this problem? Thanks in advance!!
------------------------------------------------------------------------------------------------- int commentY=800; // commentY has the 1st comment Y pixel location on a graph ... loop (i1, 2, graphno) // loop column from 2nd to end { ... plotxy [%(rPage.name$)]1!(1,$(i1)) plot:=202 ogl:=[<new template:=%(tmpPathName$)>]; // draw new graph with 1st worksheet GObject cmt1=label; label -s -d 3800 commentY -n cmt1 "%(@LC)"; // 1st column comment display on a graph cmt1.fsize=16; ... loop (i2, 2, compno) // loop worksheet from 2nd to end { plotxy [%(rPage.name$)]($(i2))!(1,$(i1)) plot:=202 ogl:=1; // add a graph line using from 2nd to end layers commentY=commentY+i2*100; // commentY has the 2nd~4th Y pixel location on a graph GObject cmt2=label; label -s -d 3800 commentY -n cmt2 "%(i2, @LC)"; cmt2.fsize=16; ... } ... } |
Edited by - hkkim on 01/04/2013 01:33:22 AM |
|
|
Kathy_Wang
China
159 Posts |
Posted - 01/06/2013 : 01:02:21 AM
|
Hi,
So far as I can see from the parts of your script, in every loop the previously generated label will be replaced by the new label, as you used "label -n" option which replaces the specified label.
So in case you want to show 4 labels, you need to create 4 labels, for example when you define GObject cmt2, instead of attach it to "Label" which is the same label cmt1 attached to, attach it to a new label object "Label1" by:
GObject cmt2 = Label1;
Kathy Originlab |
|
|
hkkim
Republic of Korea
35 Posts |
Posted - 01/06/2013 : 8:39:34 PM
|
Dear Kathy,
Thank you for your comment. I'm still not familiar with OOP. My code runs well now. Thanks again!
hkkim |
|
|
|
Topic |
|
|
|