Is it possible to script Graph Builder to bring reference lines to the frontIs there way through JSL to move reference lines to the front of the plot so that they are clearly visible over the datapoints?
I know I can right-click, customize on within individual frame boxes and manually reorder the items in the list, but i'd like to do this via JSL if possible.
Appreciate any suggestions/feedback you might have.
Thanks,
Ray

Code to replicate the graph above.
names default to here(1);<BR />dt = open ( "$SAMPLE_DATA/Aircraft Incidents.jmp" );<BR />dt << Graph Builder(
Size( 964, 585 ),
Show Control Panel( 0 ),
Graph Spacing( 3 ),
Spacing Borders( 1 ),
Variables( X( :Event Date ), X( :Amateur Built ), Y( :Latitude ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 94 ) ),
Smoother( X, Y, Legend( 95 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y, Legend( 96 ) ),
Box Plot( X, Y, Legend( 97 ), Outliers( 0 ) )
),
SendToReport(
Dispatch(
{},
"Latitude",
ScaleBox,
{Min( 0 ), Max( 110.494221427167 ), Inc( 20 ), Minor Ticks( 3 ),
Add Ref Line( 42.1037140060617, "Solid", "Red", "", 1 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 2 ),
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" )}
)
)
)
Automation and ScriptingMass CustomizationRe: Is it possible to script Graph Builder to bring reference lines to the frontIf you change the order within customize graph, JMP will add Reference Line Order to your script (at least in JMP19). You can then search that from Scripting Index to get an idea what you could possibly do.
Re: Is it possible to script Graph Builder to bring reference lines to the frontDoes this modified script work?
Graph Builder(
Size( 964, 585 ),
Show Control Panel( 0 ),
Graph Spacing( 3 ),
Spacing Borders( 1 ),
Variables( X( :Event Date ), X( :Amateur Built ), Y( :Latitude ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 94 ) ),
Smoother( X, Y, Legend( 95 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y, Legend( 96 ) ),
Box Plot( X, Y, Legend( 97 ), Outliers( 0 ) )
),
SendToReport(
Dispatch( {}, "Latitude", ScaleBox,
{Min( 0 ), Max( 110.494221427167 ), Inc( 20 ), Minor Ticks( 3 ),
Add Ref Line( 42.1037140060617, "Solid", "Red", "", 1 )}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" ),
Reference Line Order( 3 )}
),
Dispatch( {}, "Graph Builder", FrameBox( 2 ),
{Marker Size( 4 ), Marker Drawing Mode( "Outlined" ),
Reference Line Order( 3 )}
)
)
);
If so, I simply clicked the Red Triangle at the top of GB and select Save Script > To Clipboard after interactively changing the rendering order so the Reference Lines followed the Markers.
Re: Is it possible to script Graph Builder to bring reference lines to the front@jthi & @Mark_Bailey - Thank you both.
Those answers led me to this
r = current report();
frameBoxList = r << XPath( "//FrameBox" );
// Giving a large enough number as input to Reference Line Order( )
// to ensure reference lines are brought to the front.
frameBoxList << Reference Line Order( 100 );
// Or alternatively, I found seg count() which returns the number <BR />// of segs in a frame so could use that to set specific count for each one if needed.
frameBoxList[1] << seg count();