Hi all,
I need to change the data point label positions. My problem is that I need to define the new label positions (see variable LabelPosText) inside the expression statement. I know this wouldn't be necessary in the example below, but I want to spare you the effort of working through my long code, so I'm showing you a simplified example.
I am now failing to get the content of the variable LabelPosText into the Graph Builder expression part (the respective line is labeled with //here I need help ). I have tried several combinations of Eval(), Eval Expr(), etc., but nothing has worked for me.
Thanks a lot for your help!
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Eval(
Parse(
"dt << New Script(\!"test script\!",
//defining new label positions for some data points
Rows = dt << get rows where( :Sex == \!"F\!" );
LabelPosText = \!"\!";
For Each({row, idx}, Rows,
WeightValue = Column( dt, \!"weight\!")[row];
HeightValue = Column( dt, \!"height\!")[row];
LabelPosText = LabelPosText || \!"{\!"|| char(row-1) ||\!", -5, 12, \!"|| char(WeightValue) ||\!", \!"|| char(HeightValue) ||\!"}\!";
if(idx < N Items(Rows),
LabelPosText = LabelPosText || \!", \!"
)
);
Graph Builder(
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch( {}, \!"Graph Builder\!", FrameBox,
{DispatchSeg(
Marker Seg( 1 ),
{Label Offset( LabelPosText ), //here I need help ;)
Set Force Labels( \!"Label by Row\!" )}
)}
)
)
)
)"
)