Ouch!
I just detected the Cumulative Percent item in the Summary settings:
This way it gets much easier to generate a grouped CDF Plot - even with the possibility to use a column switcher.
edit: unfortunately, this code is wrong - see below
Names Default To Here( 1 );
verbose = 1;
dt = Current Data Table();
myCols = {};
ex = New Window( "Modal Dialog example",
"Modal",
V List Box(
Lineup Box( N Col( 2 ),
Panel Box( "", fcs = Filter Col Selector() ),
Panel Box( "",
Lineup Box( N Col( 2 ),
Button Box( "variables", variableColsLB << append( fcs << get selected ) ),
variableColsLB = Col List Box(Continuous, width( 200 ), min items( 1 ), nlines( 10 ) ),
Button Box( "group by", groupColLB << append( fcs << get selected ) ),
groupColLB = Col List Box( Nominal, width( 200 ), max items( 1 ), min items( 1 ), nlines( 1 ) )
)
)
),
H List Box(
Button Box( "OK",
For Each( {col, idx}, variableColsLB << get items(), Insert Into( myCols, Name Expr( As Column( dt, col ) ) ) );
groupColName = (groupColLB << get items)[1];
groupCol = Name Expr( As Column( dt, groupColName ) );
),
Button Box( "cancel" )
)
)
);
If(
Not( ex["button"] == 1 ), Stop(),
N Items( myCols ) == 0,
Stop()
);
col1 = myCols[1];
Eval(
Substitute(
Expr(
dt << Graph Builder(
Show Control Panel( 0 ),
Show Title( 0 ),
Size( 500, 300 ),
Variables( X( __col1__ ), Y( __col1__ ),Overlay( __groupCol__ ) ),
Elements( Points( X, Y, Summary Statistic( "Cumulative Percent" ) ) ),
Column Switcher( __col1__, __myCols__ ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Cumulative Distribution Plot" ), Image Export Display( Normal )} )
)
)
),
Expr( __col1__ ), Name Expr( col1 ),
Expr( __myCols__ ), Name Expr( myCols ),
Expr( __groupCol__ ), Name Expr( groupCol ),
)
);