cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Eduardo
Level III

Set axis font size outside Graph builder script

Hello all,

I've been searching for this one...including the scripting index under help. I would like to change the font size  of my x-axis using a code line outside the graph builder script. Please see below. I tried the line 

Report(graph)[Axis Box( 1 )] << Axis Settings({Set Font Size(14)}) but this line does not work of course. I know how to change the font size within the script of graph builder, but how to do it via a code line outside so that at any time I can change the font size of my x-axis? Thanks for any help! I'm using JMP 12.

 

graph = Graph Builder(
	Size( 1836, 599 ),
	Show Control Panel( 0 ),
	Legend Position( "Bottom" ),
	Variables( X( :marker ), Y( :Name( "uma" ) ), Y( :Name( "ina" ), Position( 1 ) ) ),
	Elements( Bar( X, Y( 1 ), Y( 2 ), Legend( 3 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"marker",
			ScaleBox,
			{Label Row( {Show Major Grid( 1 ), Set Font Size( 6 )} )} //this way I know but I want to do it from outside
		),
		Dispatch(
			{},
			"uma",
			ScaleBox,
			{Add Ref Line( -4, "Dotted", "Black", "", 1 ), Add Ref Line( 4, "Dotted", "Black", "", 1 )}
		)
	)
);
 
Report( graph )[Axis Box( 1 )] << Axis Settings( {Set Font Size( 14 )} );
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Set axis font size outside Graph builder script

You need to pass your request to the Axis Box();

graph = Graph Builder(
	Size( 1836, 599 ),
	Show Control Panel( 0 ),
	Legend Position( "Bottom" ),
	Variables( X( :marker ), Y( :Name( "uma" ) ), Y( :Name( "ina" ), Position( 1 ) ) ),
	Elements( Bar( X, Y( 1 ), Y( 2 ), Legend( 3 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"marker",
			ScaleBox,
			{Label Row( {Show Major Grid( 1 ), Set Font Size( 6 )} )} //this way I know but I want to do it from outside
		),
		Dispatch(
			{},
			"uma",
			ScaleBox,
			{Add Ref Line( -4, "Dotted", "Black", "", 1 ),
			Add Ref Line( 4, "Dotted", "Black", "", 1 )}
		)
	)
);
 
report(graph)[axis box(1)]<<label row(set font size(14));
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Set axis font size outside Graph builder script

You need to pass your request to the Axis Box();

graph = Graph Builder(
	Size( 1836, 599 ),
	Show Control Panel( 0 ),
	Legend Position( "Bottom" ),
	Variables( X( :marker ), Y( :Name( "uma" ) ), Y( :Name( "ina" ), Position( 1 ) ) ),
	Elements( Bar( X, Y( 1 ), Y( 2 ), Legend( 3 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"marker",
			ScaleBox,
			{Label Row( {Show Major Grid( 1 ), Set Font Size( 6 )} )} //this way I know but I want to do it from outside
		),
		Dispatch(
			{},
			"uma",
			ScaleBox,
			{Add Ref Line( -4, "Dotted", "Black", "", 1 ),
			Add Ref Line( 4, "Dotted", "Black", "", 1 )}
		)
	)
);
 
report(graph)[axis box(1)]<<label row(set font size(14));
Jim
Eduardo
Level III

Re: Set axis font size outside Graph builder script

Thanks a lot Jim, it worked! Just one note for the forum: the script of the graph builder should have the automatic font size set to zero (see below).

 

graph = Graph Builder(
	Size( 1836, 599 ),
	Show Control Panel( 0 ),
	Legend Position( "Bottom" ),
	Variables( X( :marker ), Y( :Name( "uma" ) ), Y( :Name( "ina" ), Position( 1 ) ) ),
	Elements( Bar( X, Y( 1 ), Y( 2 ), Legend( 3 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"marker",
			ScaleBox,
			{Label Row(
				{Automatic Font Size( 0 ), Show Major Grid( 1 ), Set Font Size( 6 )}//THIS SETS AUTOMATIC FONT SIZE TO ZERO!!
			)}
		),
		Dispatch(
			{},
			"uma",
			ScaleBox,
			{Add Ref Line( -4, "Dotted", "Black", "", 1 ), Add Ref Line( 4, "Dotted", "Black", "", 1 )}
		)
	)
);
Report( graph )[axis box( 1 )] << label row( set font size( 14 ) );