Dans GraphBuilder, lorsque plusieurs composants sont ajoutés au même graphique, certains composants sont masqués ou sont poussés derrière d'autres et sont moins visibles.
Les segments de ligne ci-dessous sont derrière les segments de barre.

Sur le graphique, il est possible de cliquer avec le bouton droit de la souris> personnaliser et réorganiser les composants à l'aide des flèches haut / bas et d'envoyer les segments de barre vers l'arrière.


J'ai trouvé un moyen de créer un script dans JMP16 (code complet ci-dessous), mais la même solution échoue dans JMP15.
Existe-t-il une solution équivalente pour JMP15?
gbFB1 = report(gb)[Framebox(1)];
gbFB1 << Reorder Segs({1, 2, 5});
Merci
Rayon
Code JSL complet à recréer:
dt_sampledata = New Table( "Exampe Data",
Add Rows( 24 ),
New Column( "Month",
Numeric,
"Ordinal",
Format( "Best", 12 ),
Set Values(
[202101, 202101, 202101, 202101, 202102, 202102, 202102, 202102, 202103,
202103, 202103, 202103, 202104, 202104, 202104, 202104, 202105, 202105,
202105, 202105, 202106, 202106, 202106, 202106]
)
),
New Column( "Product",
Character( 16 ),
"Nominal",
Set Values(
{"ProductA", "ProductB", "ProductC", "ProductD", "ProductA", "ProductB",
"ProductC", "ProductD", "ProductA", "ProductB", "ProductC", "ProductD",
"ProductA", "ProductB", "ProductC", "ProductD", "ProductA", "ProductB",
"ProductC", "ProductD", "ProductA", "ProductB", "ProductC", "ProductD"}
)
),
New Column( "Volume",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[3869, 4964, 3188, 3109, 2623, 3447, 3179, 1038, 1781, 3195, 1621, 2034,
3231, 1390, 3187, 1998, 3280, 3570, 4443, 2150, 1638, 4083, 4242, 1186]
)
),
New Column( "Chem_A",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[5, 19, 45, 36, 35, 42, 28, 46, 33, 43, 19, 5, 11, 14, 47, 21, 5, 8, 33,
32, 7, 6, 9, 33]
)
),
New Column( "Chem_B",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[64, 38, 90, 41, 69, 70, 79, 75, 79, 59, 25, 71, 64, 65, 62, 51, 88, 79,
41, 47, 22, 62, 57, 38]
)
)
);
// Graph Builder
gb = dt_sampledata << Graph Builder(
Size( 1040, 562 ),
Variables(
X( :Month ),
Y( :Volume, Side( "Right" ) ),
Y( :Chem_A, Position( 1 ) ),
Y( :Chem_B, Position( 1 ) ),
Overlay( :Product )
),
Elements(
Line( X, Y( 2 ), Y( 3 ), Overlay( 0 ), Legend( 12 ) ),
Bar( X, Y( 1 ), Legend( 11 ), Bar Style( "Stacked" ) )
),
SendToReport(
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {12, [4, 5], 11, [0, 1, 2, 3]} )}
)
)
);<BR />gbFB1 = report(gb)[Framebox(1)];<BR /><BR />gbFB1 << Reorder Segs({1, 2, 5});<BR />
Dans la représentation JSL de Graph Builder, l'ordre des "segments" semble être défini par l'ordre dans lequel ils apparaissent dans le Éléments() argument.
Voici une idée sur la façon de réorganiser les éléments avec JSL dans JMP15. Il suppose que votre dt_sampledata est la table de données actuelle.
// Graph Builder
gb = Graph Builder(
Size( 1040, 562 ),
Variables(
X( :Month ),
Y( :Volume, Side( "Right" ) ),
Y( :Chem_A, Position( 1 ) ),
Y( :Chem_B, Position( 1 ) ),
Overlay( :Product )
),
Elements(
Line( X, Y( 2 ), Y( 3 ), Overlay( 0 ), Legend( 12 ) ),
Bar( X, Y( 1 ), Legend( 11 ), Bar Style( "Stacked" ) )
)
);
Wait( 2 );
gbexpr = gb << get script;
// Find the position of the Elements() argument
i = 1;
While( Head( Arg( gbexpr, i ) ) != Expr( Elements ), i++ );
// Move forward the most background element to front
n = N Arg( Arg( gbexpr, i ) );
reordered_elem = Eval Expr( Elements( Expr( Arg( gbexpr, {i, n} ) ), Expr( Arg( gbexpr, {i, 1} ) ) ) );
// Replace old Elements() with the new re-ordered elements
Substitute Into( gbexpr, Arg( gbexpr, i ), Name Expr( reordered_elem ) );
// Replace the graph builder
gb << close window;
Eval( gbexpr );