cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.

Combined Stacked Bars and Line Plot in One Graph

karem
Level I

Hello!

Good day.

Team,

May i request your support .

In JMP 8, is it possible to create a Stacked Bar and Line in one Graph ?

If yes, could you please teach me how to ?

Here is my sample data, to better illustrate my query (done this thru excel):

3972_Combined Stacked Bar and Line.bmp

Description: 1. X- axis is DAY

                        2. YIELD is Y-axis (left) as Line Graph

                        3. DEFECT1-5 is Y-axis (right) as Stacked Bar

I attached also the data.

Please find time to answer my query.

thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
gbu
gbu
Level III

Re: Combined Stacked Bars and Line Plot in One Graph

Something like this ?

Graph Builder(

  Show Control Panel( 0 ),

  Variables(

  X( :Day ),

  Y( :Defect1 ),

  Y( :Defect2, Position( 1 ) ),

  Y( :Defect3, Position( 1 ) ),

  Y( :Yield, Position( 1 ), Side( "Right" ) )

  ),

  Elements(

  Line( X, Legend( 8 ), Row order( 0 ), Summary Statistic( "Mean" ) ),

  Bar(

  X,

  Y( 1 ),

  Y( 2 ),

  Y( 3 ),

  Legend( 6 ),

  Bar Style( "Stacked" ),

  Summary Statistic( "Mean" )

  ),

  Line( X, Y( 4 ), Legend( 9 ), Row order( 0 ), Summary Statistic( "Mean" ) ),

  Bar( X, Legend( 10 ), Bar Style( "Stacked" ), Summary Statistic( "Mean" ) )

  ),

  SendToReport( Dispatch( {}, "400", LegendBox, {Position( {0, 1, 2, 3, -1} )} ) )

)

View solution in original post

3 REPLIES 3
gbu
gbu
Level III

Re: Combined Stacked Bars and Line Plot in One Graph

Hello,

I think that Graph Builder is available in Jmp 8. You can use it to make this kind of graphs.

This following script was done with jmp 9 and give similar result than Excel one.

=============================

Graph Builder(

  Show Control Panel( 0 ),

  Variables(

  X( :Day ),

  Y( :Defect1 ),

  Y( :Defect2, Position( 1 ) ),

  Y( :Defect3, Position( 1 ) ),

  Y( :Yield, Position( 1 ) )

  ),

  Elements(

  Line( X, Y( 4 ), Legend( 8 ), Row order( 0 ), Summary Statistic( "Mean" ) ),

  Bar(

  X,

  Y( 1 ),

  Y( 2 ),

  Y( 3 ),

  Legend( 6 ),

  Bar Style( "Stacked" ),

  Summary Statistic( "Mean" )

  )

  )

)

=============================

You can also read this post on jmp blog.

Graph Builder in JMP: A Short Demo and Tutorial - JMP Blog

karem
Level I

Re: Combined Stacked Bars and Line Plot in One Graph

Hi! Gbu,

Thank you very much for your response.

I tried your recommendation. It is almost there. But i need the Defect/s in the Right Y-Axis.

3984_almost combined.bmp

Can you further improve the script ?

Sorry, i really can't figure it out using the Graph Builder.

best regards,


gbu
gbu
Level III

Re: Combined Stacked Bars and Line Plot in One Graph

Something like this ?

Graph Builder(

  Show Control Panel( 0 ),

  Variables(

  X( :Day ),

  Y( :Defect1 ),

  Y( :Defect2, Position( 1 ) ),

  Y( :Defect3, Position( 1 ) ),

  Y( :Yield, Position( 1 ), Side( "Right" ) )

  ),

  Elements(

  Line( X, Legend( 8 ), Row order( 0 ), Summary Statistic( "Mean" ) ),

  Bar(

  X,

  Y( 1 ),

  Y( 2 ),

  Y( 3 ),

  Legend( 6 ),

  Bar Style( "Stacked" ),

  Summary Statistic( "Mean" )

  ),

  Line( X, Y( 4 ), Legend( 9 ), Row order( 0 ), Summary Statistic( "Mean" ) ),

  Bar( X, Legend( 10 ), Bar Style( "Stacked" ), Summary Statistic( "Mean" ) )

  ),

  SendToReport( Dispatch( {}, "400", LegendBox, {Position( {0, 1, 2, 3, -1} )} ) )

)