cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
PNash
Level II

Spacing in side-by-side bar chart

Is there anyway to put gaps between the side-by-side bars?  I want to have the bars labeled but you can see that the labels look like garbage because they just overlap.  I really don't want to make the font any smaller.  Any ideas?

 

 2019-01-11_10-39-39.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Spacing in side-by-side bar chart

@PNash, here are the main points of my reply:

  1. The number of bars, the frame size and bar width will control the spacing of the bars and allowable printable space, then of course font size.
  2. The x-axis, color categories and Group X will determine the number of bars.
  3. Your data as specified appears to add a new category every couple weeks, which creates empty bars, and hence, increases the number of bars. 
  4. There are a couple of alternates that might be better.

Explanations:

  1. Take your graph and with your mouse drag the right edge. Note the spacing and bar size change and some of the overlapping labels will no longer overlap.  Now right click in the graph space and select Bar  on the left.  Then change the Width Proportion from 0 to .6. Note there is more spacing between the bars, but that does not increase readability of the labels.
  2. Exclude a category and there will be more room for labels since there are fewer bars. The examples in #4 will demonstarte this.
  3. I created a table that represents your summarized data, the Percent is the Y-axis, then unstacked it. See below.  If a new category continues to be added every few weeks, your graph will be unreadable (as it is displayed in your post).  The stacked table is attached.image.png
  4. Below are several graphs. The first is the result of following the steps in #1. If the Legend Position is moved to the Bottom, none of the labels overlap, since moving the legend, makes the graph space bigger. Plot #1 - Frame Size Increased, Bar Width ReducedPlot #1 - Frame Size Increased, Bar Width ReducedThis next graph was uses a custom X axis that only plots the non-missing categories for that WorkWeek. The attached table displays the formula to create the custom column WorkWeek_Item.Plot #2 - Custom X-Axis (empty categories not shown) & Bar Width ReducedPlot #2 - Custom X-Axis (empty categories not shown) & Bar Width ReducedThis third graph would require a summary column, and places the labels below the bars. This allows setting the label orientation to Angled or Perpendicular ... no overlapping labels Plot #3 - Custom X-Axis Label, Bar Width & Legend on the BottomPlot #3 - Custom X-Axis Label, Bar Width & Legend on the BottomThis fourth graph demonstrates another method to reduce the number of bars.  Both the bar labels and the :Label axis variable are shown. Here the width of the WorkWeek will be the max number of Categories in any one week, instead of the total number of Categories. For your data, there was a max of 3 Catgories in any one week so the spacing for WorkWeek is 3 bars.Plot #4 - Number of Bars Reduced (no empty categories) & Bar Width ReducedPlot #4 - Number of Bars Reduced (no empty categories) & Bar Width ReducedThe stacked table with the new columns and a script are attached. The  saved GraphBuilder script for each of the 4 plots is included.

 

This was tested on JMP PRO 14.2, Windows 10.

View solution in original post

1 REPLY 1
gzmorgan0
Super User (Alumni)

Re: Spacing in side-by-side bar chart

@PNash, here are the main points of my reply:

  1. The number of bars, the frame size and bar width will control the spacing of the bars and allowable printable space, then of course font size.
  2. The x-axis, color categories and Group X will determine the number of bars.
  3. Your data as specified appears to add a new category every couple weeks, which creates empty bars, and hence, increases the number of bars. 
  4. There are a couple of alternates that might be better.

Explanations:

  1. Take your graph and with your mouse drag the right edge. Note the spacing and bar size change and some of the overlapping labels will no longer overlap.  Now right click in the graph space and select Bar  on the left.  Then change the Width Proportion from 0 to .6. Note there is more spacing between the bars, but that does not increase readability of the labels.
  2. Exclude a category and there will be more room for labels since there are fewer bars. The examples in #4 will demonstarte this.
  3. I created a table that represents your summarized data, the Percent is the Y-axis, then unstacked it. See below.  If a new category continues to be added every few weeks, your graph will be unreadable (as it is displayed in your post).  The stacked table is attached.image.png
  4. Below are several graphs. The first is the result of following the steps in #1. If the Legend Position is moved to the Bottom, none of the labels overlap, since moving the legend, makes the graph space bigger. Plot #1 - Frame Size Increased, Bar Width ReducedPlot #1 - Frame Size Increased, Bar Width ReducedThis next graph was uses a custom X axis that only plots the non-missing categories for that WorkWeek. The attached table displays the formula to create the custom column WorkWeek_Item.Plot #2 - Custom X-Axis (empty categories not shown) & Bar Width ReducedPlot #2 - Custom X-Axis (empty categories not shown) & Bar Width ReducedThis third graph would require a summary column, and places the labels below the bars. This allows setting the label orientation to Angled or Perpendicular ... no overlapping labels Plot #3 - Custom X-Axis Label, Bar Width & Legend on the BottomPlot #3 - Custom X-Axis Label, Bar Width & Legend on the BottomThis fourth graph demonstrates another method to reduce the number of bars.  Both the bar labels and the :Label axis variable are shown. Here the width of the WorkWeek will be the max number of Categories in any one week, instead of the total number of Categories. For your data, there was a max of 3 Catgories in any one week so the spacing for WorkWeek is 3 bars.Plot #4 - Number of Bars Reduced (no empty categories) & Bar Width ReducedPlot #4 - Number of Bars Reduced (no empty categories) & Bar Width ReducedThe stacked table with the new columns and a script are attached. The  saved GraphBuilder script for each of the 4 plots is included.

 

This was tested on JMP PRO 14.2, Windows 10.