Choose Language Hide Translation Bar

## Graph Builder: 2 Y's Bar(Side by side)?

I would like to create a graph using X( :Year) and both Y( :Cost1) and Y( :Cost2) as bars side by side. My code looks like this:

New Window(

Graph Builder( Show Control Panel( 1),

Variables(

X( :Year), Y( :Cost1), Y( :Cost2)),

Elements(

Bar( X, Y, Bar Style( "Side by side"), Summary Statistic( Sum))

)

)

);

Can anyone help me get the two Y's to be side by side?

1 ACCEPTED SOLUTION

Accepted Solutions Super User Joined:

Jun 23, 2011

Solution

## Re: Graph Builder: 2 Y's Bar(Side by side)?

When using Graph Builder, drag both Y columns to the Y axis at the same time.  Here's the code:

Graph Builder(

Show Control Panel( 0 ),

Variables( X( :Year ), Y( :Cost1 ), Y( :Cost2, Position( 1 ) ) ),

Elements(

Bar(

X,

Y( 1 ),

Y( 2 ),

Legend( 3 ),

Bar Style( "Side by side" ),

Summary Statistic( "Mean" )

)

)

); Super User Joined:

Jun 23, 2011

Solution

## Re: Graph Builder: 2 Y's Bar(Side by side)?

When using Graph Builder, drag both Y columns to the Y axis at the same time.  Here's the code:

Graph Builder(

Show Control Panel( 0 ),

Variables( X( :Year ), Y( :Cost1 ), Y( :Cost2, Position( 1 ) ) ),

Elements(

Bar(

X,

Y( 1 ),

Y( 2 ),

Legend( 3 ),

Bar Style( "Side by side" ),

Summary Statistic( "Mean" )

)

)

);