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

Shading a specific time (weekends) in graph builder

Hello, I am working on a graph looking at cyclical trends and was wondering, is there any way to apply shading to specific days/times in graph builder to draw attention to the specific ranges? I have attached an example image of what I'm trying to do below, where I added shading to the weekends in a photo editing platform. 

Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Shading a specific time (weekends) in graph builder

As you didn't provide data I will use jmp's steel shipments as example. Create new column which indicates weekends

jthi_1-1714056172820.png

You can then use this column as color in graph builder

jthi_2-1714056187363.png

You can then change the colors / transparency from legend settings

jthi_3-1714056274125.png

jthi_4-1714056288525.png

 

 

Also I'm fairly sure I have seen Scott Wise do something like this (https://community.jmp.com/t5/Scott-Wise-s-Blog/bg-p/swise-blog) but couldn't quickly find it.

 

Edit:

One thing to note about my solution is that it isn't really adding "shading". It will recolor your bars and sometimes that might not be what you want. For shading type of tasks the other options here are better

-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: Shading a specific time (weekends) in graph builder

As you didn't provide data I will use jmp's steel shipments as example. Create new column which indicates weekends

jthi_1-1714056172820.png

You can then use this column as color in graph builder

jthi_2-1714056187363.png

You can then change the colors / transparency from legend settings

jthi_3-1714056274125.png

jthi_4-1714056288525.png

 

 

Also I'm fairly sure I have seen Scott Wise do something like this (https://community.jmp.com/t5/Scott-Wise-s-Blog/bg-p/swise-blog) but couldn't quickly find it.

 

Edit:

One thing to note about my solution is that it isn't really adding "shading". It will recolor your bars and sometimes that might not be what you want. For shading type of tasks the other options here are better

-Jarmo
H_1
H_1
Level I

Re: Shading a specific time (weekends) in graph builder

Fantastic, thank you for the prompt reply and instruction!

Re: Shading a specific time (weekends) in graph builder

You can add Reference Lines to the time axis that span a range of values. See the example below and the axis dialog box.

gb.JPG

axis.JPG

 

hogi
Level XI

Re: Shading a specific time (weekends) in graph builder

Reference lines are nice for 1-100 regions.

Beyond that, you could use Heatmap to get the weekends shaded fully automatically.

Nice tutorial by @John_Powell_JMP :

https://community.jmp.com/t5/Discussions/background-color-of-graph-builder/m-p/36095/highlight/true#... 

 

hogi_0-1714081165538.png

 

View more...
dt = Open( "$SAMPLE_DATA/Airline Delays.jmp" );
New Column( "day",
	Format( "y/m/d", 12 ),
	Formula(
		Date DMY(
			:Day of Month,
			Match( :Month,"Jan", 1,"Feb", 2,"Mar", 3,"Apr", 4,"May", 5,	"Jun", 6,"Jul", 7,"Aug", 8,	"Sep", 9,"Oct", 10, "Nov", 11, "Dec", 12
			),
			1972
		) + In Hours( 12 )
	)
);
Graph Builder(
	Variables( X( :day ), Y( :Arrival Delay ), Color( :Day of Week ) ),
	Elements(
		Heatmap( X, Legend( 9 ) ),
		Points( X, Y, Color( 0 ), Legend( 7 ) )
	),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				9,
				Properties(
					0,
					{Fill Color( 16 ), Transparency( 0.2 )},
					Item ID( "Sun", 1 )
				),
				Properties( 1, {Transparency( 0 )}, Item ID( "Mon", 1 ) ),
				Properties( 2, {Transparency( 0 )}, Item ID( "Tue", 1 ) ),
				Properties( 3, {Transparency( 0 )}, Item ID( "Wed", 1 ) ),
				Properties( 4, {Transparency( 0 )}, Item ID( "Thur", 1 ) ),
				Properties( 5, {Transparency( 0 )}, Item ID( "Fri", 1 ) ),
				Properties( 6, {Transparency( 0 )}, Item ID( "Sat", 1 ) )
			)}
		)
	)
);
hogi
Level XI

Re: Shading a specific time (weekends) in graph builder

The auto-adjustment of the tick spacing in GraphBuilder reduces the usefulness of the Heatmap approach - once you adjusted the tick spacing, don't dare to zoom in or out:

 

 

 

So, for Jmp <=18 it's better to use @Mark_Bailey's approach - even for N>100 : )

 

Concerning a future version of Jmp - there is already a wish to fix the issue:
Heatmap - option: fixed Tick spacing (aggregation area)