I'm trying to draw on a graph some curve. But that curve is different for some set of variables. I'm wondering if anyone has a good way to make yfunction() change based off what's selected in a local data filter. For instance, if I change age from 12 to 13, below, I want a cosine wave instead of sin wave or something like that.
Note: this is for JMP live, so I don't think filter change handlers work there. I was originally just plotting them all with a by variable drawing on each one individually, but that just doesn't work on JMP live either and I can't figure out why.
Names default to here( 1 );
dt = open("$SAMPLE_DATA\Big Class.jmp");
dt << Graph Builder(
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 43 ) ), Smoother( X, Y, Legend( 44 ) ) ),
Local Data Filter(
Add Filter(
columns( :age ),
Where( :age == 12 ),
Display( :age, N Items( 6 ) )
)
),
SendToReport(
Dispatch(
{},
"height",
ScaleBox,
{Min( 47.4910973084886 ), Max( 78.4293207137927 ), Inc( 5 ),
Minor Ticks( 1 )}
),
Dispatch(
{},
"weight",
ScaleBox,
{Min( 43.4685580652897 ), Max( 152.924994106993 ), Inc( 20 ),
Minor Ticks( 1 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
5,
Description( "" ),
Pen Color( "red" );
Pen Size( 3 );
Y Function(
49.5348183760347 + 101.831529865667 / 2 * (1
+Sine( (2 * Pi() * (x - 50)) / 16.6 )),
x
);
)}
)
)
);