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

How do I change graph builder color in JSL?

Hi all,

 

I made several Graph Builders below with JSL.
This is the syntax for dividing colors based on the column :XX.
But when I made several graphs, all of them came out the same color as "blue."
I want to give different colors for each graph builder, what options are available?

gb1 = dt <<
Graph Builder(
	Size( 1200, 600 ),
	Variables(
		X( :A1, Position( 1 ) ),
		Y( :Y ),
		Color( :XX )
	)
);
 

gb2 = dt <<
Graph Builder(
	Size( 1200, 600 ),
	Variables(
		X( :A2, Position( 1 ) ),
		Y( :Y ),
		Color( :XX )
	)
);


gb3 = dt <<
Graph Builder(
	Size( 1200, 600 ),
	Variables(
		X( :A3, Position( 1 ) ),
		Y( :Y ),
		Color( :XX )
	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How do I change graph builder color in JSL?

The Color() element indicates to apply different colors to different values of the color column.  It does not specify the color it's self.  To change the color in JSL, the best thing to do, is to interactively make the changes you want, and then to have JMP show you the JSL that will recreate the graph as you have created.  Here is a rework of your code to show a different color for each graph

Names Default To Here( 1 );
Graph Builder(
	Size( 1164, 556 ),
	Variables( X( :A1 ), Y( :Y ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				Properties( 0, {Line Color( "green" )}, Item ID( "weight", 1 ) )
			)}
		)
	)
);

Graph Builder(
	Size( 1164, 556 ),
	Variables( X( :A2 ), Y( :Y ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				Properties( 0, {Line Color( "Blue" )}, Item ID( "weight", 1 ) )
			)}
		)
	)
);

Graph Builder(
	Size( 1164, 556 ),
	Variables( X( :A3 ), Y( :Y ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				Properties( 0, {Line Color( "Red" )}, Item ID( "weight", 1 ) )
			)}
		)
	)
);

Additionally, please use the txnelson_1-1701055690340.png to enter JSL in your discussions.  It makes it much easier for Community Members to read the JSL.

 

 

Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: How do I change graph builder color in JSL?

The Color() element indicates to apply different colors to different values of the color column.  It does not specify the color it's self.  To change the color in JSL, the best thing to do, is to interactively make the changes you want, and then to have JMP show you the JSL that will recreate the graph as you have created.  Here is a rework of your code to show a different color for each graph

Names Default To Here( 1 );
Graph Builder(
	Size( 1164, 556 ),
	Variables( X( :A1 ), Y( :Y ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				Properties( 0, {Line Color( "green" )}, Item ID( "weight", 1 ) )
			)}
		)
	)
);

Graph Builder(
	Size( 1164, 556 ),
	Variables( X( :A2 ), Y( :Y ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				Properties( 0, {Line Color( "Blue" )}, Item ID( "weight", 1 ) )
			)}
		)
	)
);

Graph Builder(
	Size( 1164, 556 ),
	Variables( X( :A3 ), Y( :Y ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				Properties( 0, {Line Color( "Red" )}, Item ID( "weight", 1 ) )
			)}
		)
	)
);

Additionally, please use the txnelson_1-1701055690340.png to enter JSL in your discussions.  It makes it much easier for Community Members to read the JSL.

 

 

Jim