Hi there! I am working on creating a script that graphs a numerical value (X) against Tools (Y) that includes given upper and lower control limits in the data table that vary by subgroup, and will automatically include the limits on the graphs when the script is run. I also need these graphs to be separated by "Layer". Here is what I have so far. I can get the graphs to generate, but I can't seem to get the control limit lines to show up. Also, the first graph has much smaller point sizes than the rest of the graphs. I'm still relatively new to writing scripts from scratch, so any help is much appreciated! Here is what I have so far. (JMP version: 17.2)
Names Default To Here( 1 );
dt = Current Data Table();
xCol = Column( dt, "Tool" );
yCol = Column( dt, "Value" );
uclCol = Column( dt, "UCL" );
lclCol = Column( dt, "LCL" );
LayerCol = Column( dt, "Layer" );
gb = Graph Builder(
Size( 633, 6849 ),
Show Control Panel( 0 ),
Title Fill Color( "White" ),
Level Fill Color( "White" ),
Page Level Fill Color( "White" ),
Variables( X( :Tool ), Y( :Value ), Page( :Layer ) ),
Elements( Points( X, Y, Legend( 1 ) ) ),
Elements( Line( X( xCol ), Y( uclCol ), Legend( 2 ) ) ),
Elements( Line( X( xCol ), Y( lclCol ), Legend( 3 ) ) ),
SendToReport(
Dispatch( {}, "Graph", ScaleBox, {Format( "Best", 12 ), Inc( 1 ), Minor Ticks( 1 )} ),
Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 2 ), Line Width( 2 )} ),
)
);
rep = gb << Report();
fr = rep[FrameBox( 1 )];
leg = rep[LegendBox( 1 )];
leg = rep[Legend Box( 1 )];
Try( leg << Set Item Name( 1, "Value" ) );
Try( leg << Set Item Color( 1, "Steel Blue" ) );
Try( fr << Set Marker Size( 1, 3 ) );
Try( fr << Set Marker Style( 1, "FilledCircle" ) );
Try( leg << Set Item Name( 2, "UCL" ) );
Try( leg << Set Item Name( 3, "LCL" ) );
Try( leg << Set Item Color( 2, "Red" ) );
Try( leg << Set Item Color( 3, "Red" ) );
Try( leg << Set Item Line Style( 2, "Solid" ) );
Try( leg << Set Item Line Style( 3, "Solid" ) );
Try( fr << Set Line Width( 2, 2 ) ); // UCL
Try( fr << Set Line Width( 3, 2 ) ); // LCL
Edited by txnelson JSL into JSL Display Box