A customer would like to build a graph where there is a stacked bar chart and points above the bar. I've mocked an example using Big Class (see script below). I can get close to what she needs by nesting age within sex and also including age in the color role but can't get the stacked bars different colors or patterns. The second graph has age in the overlay role but the points are not above the bars - the customer really likes the color shading by age on the bar charts and the different colors for the stacked Y variables. So necessary elements are:
- points above bars
- ability to see stacked Y variables in the bar
- ability to denote age
The customers graph is a bit more involved than my example in that it is a trellis Grouped by Y and X variables.
Names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// New formula column: height+weight
dt << New Column( "height+weight",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :height + :weight )
);
dt << Graph Builder(
Size( 822, 623 ),
Variables(
X( :sex ),
X( :age, Position( 1 ) ),
Y( :height ),
Y( :weight, Position( 1 ) ),
Y( :"height+weight"n, Position( 1 ) ),
Color( :age )
),
Elements(
Points( X( 1 ), X( 2 ), Y( 3 ), Legend( 5 ) ),
Bar( X( 1 ), X( 2 ), Y( 1 ), Y( 2 ), Legend( 6 ), Bar Style( "Stacked" ) )
)
);
dt << Graph Builder(
Size( 570, 619 ),
Variables(
X( :sex ),
Y( :height ),
Y( :weight, Position( 1 ) ),
Y( :"height+weight"n, Position( 1 ) ),
Overlay( :age )
),
Elements(
Bar( X, Y( 1 ), Y( 2 ), Legend( 4 ), Bar Style( "Stacked" ) ),
Points( X, Y( 3 ), Legend( 5 ) )
)
);