BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
Niall
Community Trekker

How can I auto scale axis from different platforms with a single local filter on a combined page

Hi,

      I'm just starting out working with dashboards, and local filters, but I'm having some difficulties. I'm trying to generate a single page summary of a routine bit of analysis for me. I can create the window with the elements I'd want and the filter works across the various platforms (2xOneway and 1xBivariate graphs) in terms of the data that's displayed in each graph, however the Axis on the 2xOneway graph rescales with changes to the local filter, but the Bivariate doesen't - is there a way to get the Bivariate graph to also re-scale when I change the local filter selection?  

 

Here's my section of code to create the combined window ( I'm not a coder so it might not be pretty!)

 

nw = new window( "DASHBORAD DEVELOPMENT",
	Data Filter Context Box(
		V List Box(
			H List Box(
				Current Data Table() << Data Filter(
					Conditional,
					Local,
					Add Filter(
						columns( :PRODUCTION_LINE, :PRESS_ID, :AREA_ID, :METROLOGY_FLAG, :Desport_Flag),
						Display( :AREA_ID, Size( 160, 75 ), List Display ),
						Display( :PRESS_ID, Size( 143, 30 ), List Display )
					)
				),
				Oneway(
					Y( :HEIGHT),
					X( :MACH ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport(
						Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} )
					)
				),
				Oneway(
					Y( :HEIGHT),
					X( :OPERATOR),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport(
						Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} )
					)
				)
			),
			Bivariate(
				Y( :HEIGHT ),
				X( :PRODUCTION_DATE),
				Automatic Recalc( 1 ),
				SendToReport(
					Dispatch(
						{},
						"Bivar Plot",
						FrameBox,
						{Frame Size( 1018, 240 )
						}
					)
				)
			)
		)
	)
);

Apologies in advance if this is something very basic that I'm missing!

Niall 

0 Kudos
2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How can I auto scale axis from different platforms with a single local filter on a combined page

The method that I have used to do this is that I would add to your Oneway Platform an  << Add Graphics Script()  that checks to see if the Y Origin() or Y Range() has changed, and then if it has, then << Copy Axis Settings from the Y axis and then << Paste Axis Settings to the Y axies on the Bivariate Platform.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

nw = New Window( "DASHBORAD DEVELOPMENT",
	originHold = 0;
	originRange = 0;
	Data Filter Context Box(
		V List Box(
			H List Box(
				Current Data Table() << Data Filter( Conditional, Local, Add Filter( columns( :Age, :Weight ) ) ),
				ow1 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Sex ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				),
				ow2 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Age ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				)
			),
			biv = dt << Bivariate(
				Y( :HEIGHT ),
				X( :Weight ),
				Automatic Recalc( 1 ),
				SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 1018, 240 )} ) )
			)
		)
	);
);
Report( ow1 )[Frame Box( 1 )] << Add Graphics Script(
	If( originHold != Y Origin() | rangeHold != Y Range(),
		originHold = Y Origin();
		rangeHold = Y Range();
		Report( ow1 )[Axis Box( 1 )] << Copy Axis Settings;
		Try( Report( biv )[Axis Box( 1 )] << Paste Axis Settings );
	)
);
Jim
0 Kudos
txnelson
Super User

Re: How can I auto scale axis from different platforms with a single local filter on a combined page

Here is a modification to the script I sent you with a nosensical  append added to the add graphics script.  It is nonsensical, but it works

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

nw = New Window( "DASHBORAD DEVELOPMENT",
	originHold = 0;
	originRange = 0;
	Data Filter Context Box(
		V List Box(
			H List Box(
				Current Data Table() << Data Filter( Conditional, Local, Add Filter( columns( :Age, :Weight ) ) ),
				ow1 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Sex ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				),
				ow2 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Age ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				)
			),
			biv = dt << Bivariate(
				Y( :HEIGHT ),
				X( :Weight ),
				Automatic Recalc( 1 ),
				SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 1018, 240 )} ) )
			)
		)
	);
);
Report( ow1 )[Frame Box( 1 )] << Add Graphics Script(
	If( originHold != Y Origin() | rangeHold != Y Range(),
		originHold = Y Origin();
		rangeHold = Y Range();
		Report( ow1 )[Axis Box( 1 )] << Copy Axis Settings;
		Try( Report( biv )[Axis Box( 1 )] << Paste Axis Settings );
		Report( biv )[Outline Box( 1 )] << append( text box("Changed " || char(originHold)))
	);
	
);
Jim
0 Kudos
4 REPLIES 4
txnelson
Super User

Re: How can I auto scale axis from different platforms with a single local filter on a combined page

The method that I have used to do this is that I would add to your Oneway Platform an  << Add Graphics Script()  that checks to see if the Y Origin() or Y Range() has changed, and then if it has, then << Copy Axis Settings from the Y axis and then << Paste Axis Settings to the Y axies on the Bivariate Platform.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

nw = New Window( "DASHBORAD DEVELOPMENT",
	originHold = 0;
	originRange = 0;
	Data Filter Context Box(
		V List Box(
			H List Box(
				Current Data Table() << Data Filter( Conditional, Local, Add Filter( columns( :Age, :Weight ) ) ),
				ow1 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Sex ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				),
				ow2 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Age ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				)
			),
			biv = dt << Bivariate(
				Y( :HEIGHT ),
				X( :Weight ),
				Automatic Recalc( 1 ),
				SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 1018, 240 )} ) )
			)
		)
	);
);
Report( ow1 )[Frame Box( 1 )] << Add Graphics Script(
	If( originHold != Y Origin() | rangeHold != Y Range(),
		originHold = Y Origin();
		rangeHold = Y Range();
		Report( ow1 )[Axis Box( 1 )] << Copy Axis Settings;
		Try( Report( biv )[Axis Box( 1 )] << Paste Axis Settings );
	)
);
Jim
0 Kudos
Niall
Community Trekker

Re: How can I auto scale axis from different platforms with a single local filter on a combined page

Jim,
Firstly thanks for the reply, it's very much appreciated! This works
perfectly for the case I asked about.

Is it possible to use the same sort of approach (Add Graphics Script) when
using append() to add a section to an existing open window? I've tried to
include it in the append function but it gives me back an error?
0 Kudos
txnelson
Super User

Re: How can I auto scale axis from different platforms with a single local filter on a combined page

Here is a modification to the script I sent you with a nosensical  append added to the add graphics script.  It is nonsensical, but it works

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

nw = New Window( "DASHBORAD DEVELOPMENT",
	originHold = 0;
	originRange = 0;
	Data Filter Context Box(
		V List Box(
			H List Box(
				Current Data Table() << Data Filter( Conditional, Local, Add Filter( columns( :Age, :Weight ) ) ),
				ow1 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Sex ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				),
				ow2 = dt << Oneway(
					Y( :HEIGHT ),
					X( :Age ),
					Automatic Recalc( 1 ),
					Means( 1 ),
					Mean Diamonds( 1 ),
					SendToReport( Dispatch( {}, "Oneway Anova", OutlineBox, {Close( 1 )} ) )
				)
			),
			biv = dt << Bivariate(
				Y( :HEIGHT ),
				X( :Weight ),
				Automatic Recalc( 1 ),
				SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 1018, 240 )} ) )
			)
		)
	);
);
Report( ow1 )[Frame Box( 1 )] << Add Graphics Script(
	If( originHold != Y Origin() | rangeHold != Y Range(),
		originHold = Y Origin();
		rangeHold = Y Range();
		Report( ow1 )[Axis Box( 1 )] << Copy Axis Settings;
		Try( Report( biv )[Axis Box( 1 )] << Paste Axis Settings );
		Report( biv )[Outline Box( 1 )] << append( text box("Changed " || char(originHold)))
	);
	
);
Jim
0 Kudos
Niall
Community Trekker

Re: How can I auto scale axis from different platforms with a single local filter on a combined page

Brilliant Jim, very much appreciated!
0 Kudos