The easiest way to do this would be to open a Global Data Filter and select the X axis variable as the filter variable. It will set up a slider that will allow you to change the range.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt:age << modeling type( "continuous" );
gb1 = dt << Graph Builder(
Size( 528, 448 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
gb2 = dt << Graph Builder(
Size( 528, 448 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
dt << Data Filter(
Location( {780, 189} ),
Mode( Show( 1 ), Include( 1 ) ),
Add Filter( columns( :age ) )
);
If you want to develop your you can setup a Slider Box to change the Min and Max values of the you can setup something like this:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt:age << modeling type( "continuous" );
gb1 = dt << Graph Builder(
Size( 528, 448 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
gb2 = dt << Graph Builder(
Size( 528, 448 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
slidervar = Report( gb1 )[axisbox( 1 )] << get min;
slidervar2 = Report( gb1 )[axisbox( 1 )] << get max;
New Window( "Example",
Panel Box( "Slider Box",
H List Box(
sb = Slider Box(
Report( gb1 )[axisbox( 1 )] << get min,
Report( gb1 )[axisbox( 1 )] << get max,
slidervar,
Report( gb1 )[axisbox( 1 )] << Min( slidervar );
Report( gb2 )[axisbox( 1 )] << Min( slidervar );
),
sb2 = Slider Box(
Report( gb1 )[axisbox( 1 )] << get min,
Report( gb1 )[axisbox( 1 )] << get max,
slidervar2,
Report( gb1 )[axisbox( 1 )] << Max( slidervar2 );
Report( gb2 )[axisbox( 1 )] << Max( slidervar2 );
)
)
)
);
You can also add a graphics script to each of the Graph Builders, that detects changes in the range and origin of the AxisBox(1), and then when a change is detected, copy the AxisBox(1) settings from the graph where the change is detected, to each of the other graphs. Obviously, this is more complex, however, it does have the advantage of not having to have a separate window with a slider in it.
Jim