I am trying to change the orientation of the labels and the format (Engineering SI) for the horizontal axis in the Distribution (histograms) plots. I can do it for the first one using a dispatch statement within the expression that I am building but I need to be able to do it for all of the histograms in the column list.
I tried inserting different types of calls to the column name between the "{}" in:
Dispatch( {},
but none cause the histograms to change. It works if I literally put the column name (i.e. {"My Column"}) only but I want it to do it for all names in the colList array.
dt = currentdatatable();
col = dt << get column names();
nc = N Items( col );
colList = {};
bin_width={};
For( i = 1, i <= nc, i++,
If(Contains (col[i],"::"),
Insert Into( colList, col[i] ))
);
For(i = 1, i <= N Items(colList), i++,
Insert Into(bin_width,0.0);
bin_width[i] = Col Max(Column(dt, colList[i])) - Col Min(Column(dt, colList[i]));
bin_width[i] = bin_width[i]/10;
);
theExpr = "dis = dt << Distribution(Stack( 1 ),
Continuous Distribution( column( column(dt,colList[1])), Set Bin Width(bin_width[1]), Label Row( Label Orientation( \!"Perpendicular\!" ) ))
";
For( i = 2, i < N Items( colList ), i++,
theExpr = theExpr || ", Continuous Distribution( column( column(dt, colList[" || Char( i ) || "])), Set Bin Width(bin_width[i]))"
);
theExpr = theExpr || ",
SendToReport(
Dispatch(
{},
\!"1\!",
ScaleBox,
{Format( \!"Engineering SI\!", 10 ), Minor Ticks( 0 ),
Label Row( Label Orientation( \!"Perpendicular\!" ) )}
)
);";
Eval( Parse( theExpr ) );