Hi,
I am trying to script some codes which will help me auto generate some variability charts based on the available column names and save them as individual PNG pictures so that I can link the pictures to my powerpoint.
But I am not sure why was the "obj" always undefined during the debug.
Would like to seek some advice on this. Thank you with much appreciation.
- Ann
dt = Open( "D:\My Drive\Program.jmp" );
// Find the Y Columns
numericColNamesList = dt << get column names( string, numeric );
For( i = N Items( numericColNamesList ), i >= 1, i--,
If(
Not(
Is Missing( Num( Word( 1, numericColNamesList[i], ":" ) ) ) == 0 &
Word( 2, numericColNamesList[i], ":" ) != ""
),
numericColNamesList = Remove( numericColNamesList, i, 1 )
)
);
// With varying Y columns and fixed X columns
For( i = 2, i <= N Items( numericColNamesList ), i++,
obj = dt << Variability Chart(
Y( ::Column( numericColNamesList[i] ) ),
X( :code, :lot, :Label, :wafer ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Connect Cell Means( 1 ),
Std Dev Chart( 0 ),
Automatic Recalc( 1 ),
SendToReport(
Dispatch(
{"Variability Chart for numericColNamesList[i]"},
"Variability Chart",
FrameBox,
{Marker Size( 6 ), Row Legend(
Label,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
)
);
obj = List( obj[i] );
For( i = 1, i <= N Items( obj ), i++,
fName = Report( obj )[Outline Box( 1 )] << Get Title;
Report( obj )[Outline Box( 1 )] << Save Picture( "$TEMP/myPics/" || fName || ".png", "PNG" );
Report( obj )[Outline Box( 1 )] << Save Picture( "$TEMP/myPics/" || fName || ".png", "PNG", append );
);