The chart that you want requires a change in the structure of your data table and the setting of some data table RowStates and Column States.
The script below changes the structure of the data table and then draws the above final graph. Everything in the script can be done interactively. In fact, everything was done interactively and then I just took the script that JMP provided and copied into one final script.
Names Default to here(1);
dt = current data table();
dtStack = dt <<
Stack(
columns(
:Parm 1 # Fails, :Parm 2 # Fails, :Parm 3 # Fails, :Parm 1 % Fail,
:Parm 2 % Fail, :Parm 3 % Fail
),
Source Label Column( "Parameter" ),
Stacked Data Column( "Counts" ),
Number of Series( 2 ),
Contiguous
);
// Change the name of the column that has the % values
dtStack:Counts 2 << set name("Percent");
// Divide each row value for the percent column to conform
// to the percent values for a JMP column
for each row(
:Percent = :Percent / 100;
);
// Change the display format for the percent column to
// display a % sign in the values
dtStack:Percent << format("Percent", 7, 0);
// A column needs to be set to have the correct display values for
// the legend. Also, the alphabetical ordering will determine the
// order of the subbar values. So recode the column to meet those
// specifications
// Recode column: Parameter
Local( {dt},
dt = dtStack;
dt << Begin Data Update;
dt << Recode Column(
dt:Parameter,
{Map Value(
_rcOrig,
{"Parm 1 # Fails", "3. Parm 1", "Parm 2 # Fails", "2. Parm 2",
"Parm 3 # Fails", "1. Parm 3"},
Unmatched( _rcNow )
)},
Update Properties( 1 ),
Target Column( :Parameter )
);
dt << End Data Update;
);
// Label column: Percent to be used to label the graph
dtStack:Percent << Label( 1 );
// Label all rows to show which values from the percent column
// to label
dtStack << Select All Rows << Label(1);
dtStack << clear selection;
dtStack << invert row selection;
// Draw the graph
Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :Month ), Y( :Counts ), Overlay( :Parameter ) ),
Elements(
Bar( X, Y, Legend( 7 ), Bar Style( "Stacked" ), Label( "Label by Row" ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
7,
Properties(
0,
{Fill Color( 73 )},
Item ID( "1. Parm 3", 1 )
),
Properties(
1,
{Fill Color( 25 )},
Item ID( "2. Parm 2", 1 )
),
Properties(
2,
{Fill Color( -7183127 )},
Item ID( "3. Parm 1", 1 )
)
)}
)
)
);
Here is the restructured data table that was used to create the final chart.
Jim