BookmarkSubscribe
Choose Language Hide Translation Bar
Achim_T
Community Trekker

How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

Is it possible to create a bar-mekko chart in JMP? see e.g.

https://kb.tableau.com/articles/howto/create-a-variable-width-bar-chart-aka-cascade-chart

 

I can create a bar chart with categories on the X-axis and Numerical on the Y-axis, and sort ascending. Then, intuitively, dragging another numerical column to the "Size" field should create such a chart (Size = widths of the bars in the chart?) but nothing happens if I do that. I can only color the bars instead, i.e. dragging to the "Color" field in the Graph builder.

 

Thanks in advance for any help.

 

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

Two options that I can think of (neither is a bar chart) that would get you close are:

1) don't use bars. Stick with a scatterplot and set the size of the point to be the production size. That would give you something like this:

Graph Builder.png

 

2) use Fit Y by X, put the Production Size in as a Frequency variable (Fit Y by X has an X-axis proportional default setting). That gives you something like this:

Fit Y by X.png

 

You could play around with some additional options to try and make them look a bit better.

Of course you could always write a script to do this.

Dan Obermiller
6 REPLIES 6

Re: How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

I'd try a packed bar chart - it's one of the options for bar charts in JMP 14.

https://community.jmp.com/t5/JMP-Blog/Introducing-packed-bars-a-new-chart-form/ba-p/39972
0 Kudos
Achim_T
Community Trekker

Re: How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

Thanks Mike, I had looked at that but this is not really what I intend here. Also, packed bars get very confusing because unrelated categories are mixed. The variable width bar charts are very common in the mining / oil & gas world, e.g. production cost on the y-axis, mine/well name as category on the x-axis, and mine/well production size as bar width. Would be cool if this could be added in the graph builder at some point (like I described via dragging a column on the size field with a bar chart).

0 Kudos

Re: How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

Two options that I can think of (neither is a bar chart) that would get you close are:

1) don't use bars. Stick with a scatterplot and set the size of the point to be the production size. That would give you something like this:

Graph Builder.png

 

2) use Fit Y by X, put the Production Size in as a Frequency variable (Fit Y by X has an X-axis proportional default setting). That gives you something like this:

Fit Y by X.png

 

You could play around with some additional options to try and make them look a bit better.

Of course you could always write a script to do this.

Dan Obermiller
Achim_T
Community Trekker

Re: How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

Thanks Dan, I will try the scripting and the suggested alternatives.

0 Kudos
Highlighted
gzmorgan0
Super User

Re: How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

Attached is a very simple script that builds on Dan's suggestion. It shows how to make bars instead of points. I tested it on JMP 12, 13 and 14.

 

If I were building an application, I'd create a summary table based upon user input and likely build the graph using Shape Seg with rowstates associated with the table.

 

image.png

gzmorgan0
Super User

Re: How to create a bar-mekko chart (variable width bar chart) in JMP / Graph Builder

Oh, one more suggestion. Mosaic plots scale by N/Weight. You might want to resarch them in the Scripting Index.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = Distribution( Column( :Age ) );
obj << Mosaic Plot( 1 );

image.png

0 Kudos