cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

Adding visual separator in graphbuilder/bar chart

Hello, 

I often use graph builder together with the bar chart option (2 levels category)

I would like to add visual separators so the eye can differenciate between top categories.

Do you think it is possible?

thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Adding visual separator in graphbuilder/bar chart

I think you would have to go with stacked bar chart.

 

Mosaic

jthi_0-1762536761185.png

% of Factor Stacked Bar chart with width proportion set to 0.95

jthi_2-1762536904048.png

 

 

-Jarmo

View solution in original post

8 REPLIES 8
jthi
Super User

Re: Adding visual separator in graphbuilder/bar chart

You could try adjusting Graph Spacing

jthi_0-1762529867528.png

It might add too much spacing for you as it will separate all the categories

jthi_1-1762530080051.png

You could also possibly move your X-Group columns to X-Axis and tinker with axis settings

jthi_2-1762530145509.png

 

-Jarmo

Re: Adding visual separator in graphbuilder/bar chart

Thanks Jarmo for the prompt answer. Indeed, I have tried graph spacing and the issue is that this is spacing all bars not one level unfortunately

jthi
Super User

Re: Adding visual separator in graphbuilder/bar chart

If you start with something like this

jthi_0-1762532436510.png

Move age to X-axis and add graph spacing

jthi_1-1762532461303.png

At least this way you could control the graph spacing but you will end up separating the groupings.

With scripting you could add V Line() when the "top group" changes (this is hard-coded example)

fbs = Current Report() << XPath("//FrameBox");

fbs[6] << Add Graphics Script(
	Pen Size(10);
	V Line(0.5)
);

fbs[7] << Add Graphics Script(
	Pen Size(10);
	V Line(-0.5)
);

jthi_2-1762532807525.png

Edit: If you are doing this by hand you can also use simple shape annotation (these can be scripted but it is annoying)

jthi_0-1762534558655.png

jthi_1-1762534567550.png

 

 

 

-Jarmo

Re: Adding visual separator in graphbuilder/bar chart

Something like this might be adequate.

 

(gb << XPath( "//FrameBox" )) << Border( Left( 2 ), Right( 2 ) ) << Margin( Left( 2 ), Right( 2 ) );

mmarchandFSLR_0-1762532937044.png

 

Re: Adding visual separator in graphbuilder/bar chart

For some reasons, when I place one category to X-axis, the width of the bar are changing (dim2 is set as nominal FYI)

jthi
Super User

Re: Adding visual separator in graphbuilder/bar chart

Re: Adding visual separator in graphbuilder/bar chart

You are right jthi. This is Mosic plot. Do you know by chance a way to do the same plot as Mosaic but the width is not varying for the top level category?

jthi
Super User

Re: Adding visual separator in graphbuilder/bar chart

I think you would have to go with stacked bar chart.

 

Mosaic

jthi_0-1762536761185.png

% of Factor Stacked Bar chart with width proportion set to 0.95

jthi_2-1762536904048.png

 

 

-Jarmo

Recommended Articles