Thanks Jim, but this is still having one small issue. Somehow all plots are getting the same legend.
For example, something like this. the legend changes everytime in the loop. however, the legends are not being picked up in the var charts. i always get the final legend column legends in all plots
nw = New Window( "test", vlb = V List Box() );
dt = Current Data Table();
mycolumnList = {"species", "subject", "season"};
mylegendList = Associative Array({"species","subject","season"},{"FOX","2","summer"});
For( i = 1, i <= N Items( mycolumnList ), i++,
Try( dt << delete column( "LegendCol" ) );
//legend = "ABC";
legend = mylegendList[mycolumnList[i]];
Eval(
Substitute(
Expr(
Try(
dt << New Column( "LegendCol", Formula( If( Char( As Column( _mycolumnList_ ) ) == _legend_, "first", "rest" ) ) )
)
),
Expr( _mycolumnList_ ), mycolumnlist[i],
Expr( _legend_ ), legend
)
);
myvarChart = vlb << append(
dt << Variability Chart(
Y( :miles ),
X( Eval( mycolumnList[i] ) ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Connect Cell Means( 1 ),
Variability Summary Report( 1 ),
Std Dev Chart( 0 ),
Points Jittered( 1 ),
Show Box Plots( 1 ),
Name( "Show Gauge R&R Specifications Dialog" )(0),
Automatic Recalc( 1 ),
SendToReport(
Dispatch(
{"Variability Gauge Analysis for miles", "Variability Chart for miles"},
"Variability Chart",
FrameBox,
{Row Legend(
LegendCol,
Color( 1 ),
Color Theme( "JMP Default"(1) ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
))));