Community Trekker

Joined:

Aug 6, 2013

## Combined Stacked Bars and Line Plot in One Graph

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):

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.

thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Community Trekker

Joined:

Jun 23, 2011

Solution

## 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} )} ) )

)

3 REPLIES

Community Trekker

Joined:

Jun 23, 2011

## 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

Community Trekker

Joined:

Aug 6, 2013

## 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.

Can you further improve the script ?

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

best regards,

Community Trekker

Joined:

Jun 23, 2011

Solution

## 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} )} ) )

)