Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
lo_user
Level I

how do i rescale multiple graphs in JMP report?

Hello, 

I have this script that creates multipe graphs and appends them in a report.  since every user has its own resolution, sometimes the graph look too big or too small on their laptop. i know you can re-size the graph with dragging the corener, but when there's 8 graphs, that becomes a tedious task. 

 

this is my general code, at the end is the script i created, the problem is, it only resizes the last graph that was created.

Build_chart = Function( {param},
	gb = dt1 << Graph Builder(
		Size(  x,  y ),
		Show Control Panel( 0 ), 
		Automatic Recalc( 1 ),
		Variables( X( :MEASUREMENT_DATE ), Y( :CHART_VALUE )),
		Elements( Points( X, Y, Legend( 1 ), Jitter( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
		Where( :parameter == param );
	

);


filter << append(
	tool_filter = Outline Box( "General data filter",
		V List Box( "Slider Box",
			tb = Text Box( "Value: " || Char( sliderValue ) ),
			sb = Slider Box( 0.4, 1, sliderValue, chart_size )
		)
	)
);

For( j = 1, j <= N Items( param_list ), j++,
	graph << append( Report( Build_chart( param_list[j] ) ) )
);

	chart_size = Expr(
	xr=sb<<get();
	tb << Set Text("Value: " || Char( xr ));
		gb << size( x*xr, y ));

thanks in advanced!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
gzmorgan0
Super User

Re: how do i rescale multiple graphs in JMP report?

I am confused by your script; I don't see where  the object graph is defined and you are appending graph builder boxes to it.

Assuming graph is a container box, such as, OutlineBox, VListBox, ScrollBox, etc. something like this should work, where w is the calculated width, similar for h.

Xpath finds all graphbuilder elements and stores it in a list (_xx), and any valid message sent to this list is applied to all items in the list.

_xx = graph << XPath( "//GraphBuilderBox");
_xx << set width( w ) << set height( h ) ;

 

 

View solution in original post

2 REPLIES 2
Highlighted
gzmorgan0
Super User

Re: how do i rescale multiple graphs in JMP report?

I am confused by your script; I don't see where  the object graph is defined and you are appending graph builder boxes to it.

Assuming graph is a container box, such as, OutlineBox, VListBox, ScrollBox, etc. something like this should work, where w is the calculated width, similar for h.

Xpath finds all graphbuilder elements and stores it in a list (_xx), and any valid message sent to this list is applied to all items in the list.

_xx = graph << XPath( "//GraphBuilderBox");
_xx << set width( w ) << set height( h ) ;

 

 

View solution in original post

Highlighted
lo_user
Level I

Re: how do i rescale multiple graphs in JMP report?

Hi, thanks it works, besides the first graph in the report. maybe i need to ditch the "Report" in the foor loop?

 

the function build_chart builds the chart. and yes theres a v_list box where it appends it to. 

 

EDIT: i had to change a panel box to v list box and now it works. 

Article Labels

    There are no labels assigned to this post.