@hogi Your script below now works in JMP 16.2 but with the following issues.
- The chart starts with no age selected and no title shown but the last one remains shown on the chart title when all age checkboxes are unchecked.
- In the actual problem, the title starts showing only when more than one check boxes are checked.
How to resolve these two issues (unless this is my JMP version specific) ?
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(
Size( 570, 518 ),
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :sex, :age, :weight ),
Display( :sex, "Check Box Display" ),
Display( :age, "Check Box Display" )
)
),
SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ) )
);
ldf = Current Report()["Local Data Filter"] << get scriptable object;
changeTitle = Function( {this},
print(this);
ldfText = Regex(ldf << get where clause(),"\( *(:age == .*?)\)","\1");
(Report( gb ) << XPath( "//TextEditBox" ))[1] << Set Text( ldfText );
);
fsh = ldf << Make Filter Change Handler(
changeTitle();
);
When it's too good to be true, it's neither