I am trying to work in Graph Builder to create a line with JSL of perfect correlation (y=x) for the scatterplot. See below using Restaurant Tips sample data as an example.
When I do this manually, here is the script that JMP generates:
Graph Builder(
Graph Spacing( 10 ),
Spacing Borders( 1 ),
Variables( X( :Bill Amount ), Y( :Tip Amount ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
SendToReport(
Dispatch( {}, "Tip Amount", ScaleBox,
{Min( -0.062875 ), Max( 72.9215829464286 ), Inc( 10 ), Minor Ticks( 1 )}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Add Graphics Script(
2,
Description( "" ),
Pen Color( "red" );
Y Function( x, x );
)}
)
)
);
Note that this is tied to this specific graph.
How can a make this universal to apply to any graph builder chart I am working on? My ultimate goal is to make this an add-in or better yet a button on graph builder (if that is possible) to draw this line for any chart I am working on.
There is an old video and some old info in the Community on this, but all of it that I could find is tied to a specific chart. I think maybe I don't understand frame box very well. I tried some scripting variations using frame box but got nowhere.
Thanks as always for any help.