How do I change the X axis label in Graph Builder using JSL - if the graph already exists?
From the enhanced log, I get e.g. :
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
SendToReport( Dispatch( {}, "X title", TextEditBox, {Set Text( "new" )} ))
);
So,
gb << SendToReport( Dispatch( {}, "X title", TextEditBox, {Set Text( "xxx" )} ))
is an easy trick ( Talking to Display boxes ) but should be avoided:
https://community.jmp.com/t5/Discussions/JMP-Script-Dispatch-Function/m-p/256386/highlight/true#M503... .
Sending a message like this one
current report()[TextEditBox(3)]<< Set Text( "new" )
...works, but tomorrow (after removing the title of the graph) it could be
current report()[TextEditBox(2)]<< Set Text( "new" )
Is there something more robust?
maybe in analogy to the SendToReport/Dispatch approach, something like:
current report()[TextEditBox("X title")]<< Set Text( "new" )