Subscribe Bookmark RSS Feed

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

hacketkm

Community Trekker

Joined:

Sep 14, 2012

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
Solution

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

        )

    )

);

1 REPLY
Solution

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

        )

    )

);