Graphique à barres empilées du générateur de graphiquesJMP 17 Vous trouverez ci-joint un tableau de données simple contenant les chiffres mensuels du nombre total de pièces, du nombre total d'échecs, du % d'échecs totaux, puis des nombres individuels pour lesquels le paramètre a échoué. Le graphique à barres empilées que je souhaite est le mois sur l'axe X et le % d'échecs totaux sur l'axe Y. Ensuite, j'aimerais que ces barres soient empilées avec la rupture à partir de laquelle le paramètre a échoué selon le pourcentage mensuel de chaque paramètre. Vous trouverez ci-dessous une capture d'écran, voir Fig 1, de quelque chose que j'ai dessiné en ppt. Je n'ai pas pu obtenir cela dans Graph Builder. J'ai essayé d'empiler les données, de manipuler les colonnes, mais sans succès.
En résumé, je veux le pourcentage total global de pièces défaillantes sur l'axe Y sous forme de barre, puis cette barre indiquant le pourcentage de chaque paramètre qui a échoué pour chaque mois. Un exemple de tableau de données est joint ci-dessous. Merci.
Fig. 1

Exploration et visualisation des donnéesles fenêtresRe : Graphique à barres empilées du générateur de graphiquesJim :
Merci pour votre réponse. Je ne connaissais pas l'option Multiple Series Stack, c'est donc un bon conseil. Le seul problème avec le graphique que vous avez généré était l'axe Y. Je cherchais le % total par mois comme hauteur totale de la barre. Donc pour janvier, ce serait 10 %, 4 % en février et 15 % en mars. L’axe Y correspond au pourcentage mensuel global d’échecs. Ensuite, chacune de ces barres serait subdivisée en pourcentages des paramètres défaillants. La barre globale de 10 % de janvier serait subdivisée en 20 % Parm 1 / 80 % Parm 2. La barre globale de 4 % de février serait subdivisée en 16,7 % Parm 1 / 50 % Parm 2 / 33,3 % Parm 3. Ensuite, la barre globale de 15 % de mars serait subdivisée 37 % Parm 1 / 29,6 % Parm 2 / 33,3 % Parm 3. Je devrai peut-être ajuster davantage le tableau car je ne peux pas encore le faire via Graph Builder. Merci encore.
Re : Graphique à barres empilées du générateur de graphiquesLe graphique que vous souhaitez nécessite une modification de la structure de votre table de données et la définition de certains états de ligne et de colonne de certaines tables de données.

Le script ci-dessous modifie la structure du tableau de données, puis dessine le graphique final ci-dessus.Tout dans le script peut être fait de manière interactive.En fait, tout a été fait de manière interactive, puis j'ai simplement pris le script fourni par JMP et l'ai copié dans un script final.
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 )
)
)}
)
)
);
Voici le tableau de données restructuré qui a été utilisé pour créer le graphique final.

Re : Graphique à barres empilées du générateur de graphiquesJim :
J'ai finalement réussi à faire fonctionner quelque chose via Graph Builder. Merci pour la solution que vous avez apportée. Les séries multiples que vous avez soulignées sont d'une grande aide pour l'avenir, ainsi que le code de cet exercice. Merci encore.
Re : Graphique à barres empilées du générateur de graphiquesPasser au % du total est une formule mathématique simple, donnez les colonnes du tableau de données empilées.Je viens d'ajouter une nouvelle colonne appelée % du total, puis je l'ai utilisée dans le graphique comme axe Y.

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" );
dtStack << New Column( "% of Total", Format( "Percent", 7, 0 ) );
// Divide each row value for the percent column to conform
// to the percent values for a JMP column
For Each Row(
:Percent = :Percent / 100;
:"% of Total"n = :counts / :Total Fails * (:total % Fail / 100);
);
// Change the display format for the percent column to
// display a % sign in the values
dtStack:Percent << Format( "Percent", 7, 1 );
// 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( :"% of Total"n ), 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 )
)
)}
)
)
);