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 ) )
)
);
try this: add your y variable to the y axis twice. Once as a bar, and then right click and Add Points. Then the height, or whatever variable you have on the Y is with the bar, and also with points. If the points are above the bar, they will be able to see them.
I did it with this data:

will this work for what they want?
The points are a different Y variable than what is stacked in the graph so I don't think it will work. I did play around with that idea and it doesn't seem to do the trick.
Can you put the different Y variable on the Y2 axis to get it to work? While also adding it to the overlay or color role?
The points still won't be above the bars - because overlaying by a categorical variable will separate the bars but not points.
Sounds to me like the customer wants to do too much with color: different colors for the stacked elements in each bar, while also a continuous color gradient by age. We just don't do that.
Maybe encourage the customer to find a different way to represent either the ages or the stacked overlay. Color can't be used for both simultaneously.
I don't think the problem is necessarily the color; below is a graph where colors have been used for the categories, and a continuous gradient for :weight (color or mark by column). Not sure this is what is wanted though.

I thought the desired graph would have different colors within each stacked bar, and then a gradient of those two colors across the different bars. That's not possible in graph builder, as far as I know.