Salut tout le monde
J'ai la partie suivante d'un script de saisie utilisateur. Le script fonctionne effectivement bien. Le problème vient du moment où j'ai essayé d'ajouter une ligne de grille au tracé avec jsl, cette partie ne semble pas fonctionner. J'ai essayé de remplacer X1 par x1col, Y1 par y1col (et ainsi de suite) mais cela ne semble pas fonctionner aussi. Lorsque je passe la souris sur X1, par exemple, la colonne correcte s'affiche. Je savais que je pouvais simplement glisser-déposer, mais comme je travaille sur un grand ensemble de données et que je génère des tracés, c'est bien de les automatiser. Veuillez indiquer comment puis-je surmonter ce problème.
x1col = Column(dt, X1);
y1col = Column(dt, Y1);
y2col = Column(dt, Y2);
y3col = Column(dt, Y3);
y4col = Column(dt, Y4);
Graph Builder(
Variables(X(Column(dt, X1)), Y(Column(dt, Y1)), Y(Column(dt, Y2)),Y(Column(dt, Y3)),Y(Column(dt, Y4)),
Group X( :Title )
),
Elements( Position( 1, 1 ), Line( X, Y )),
Elements( Position( 1, 2 ), Line( X, Y )),
Elements( Position( 1, 3 ), Line( X, Y )),
Elements( Position( 1, 4 ),
//Bar( X, Y, Legend( 36 ), Summary Statistic( "N" ) )
Bar( X, Y, Summary Statistic( "N" ))),
SendToReport(
Dispatch(
{},
<EM>X1</EM>,
ScaleBox,
{Label Row( Label Orientation( "Vertical" ) )}
),
Dispatch( {}, :<EM>Y1</EM>, ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch(
//{},
<EM>Y2</EM>,
ScaleBox,
{Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, <EM>Y3</EM>, ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, <EM>Y4</EM>, ScaleBox, {Label Row( Show Major Grid( 1 ) )} )
)
),Merci.
Merci gzmorgan0, ça marche parfaitement !!
L'instruction GraphBuilder Scale Box Dispatch souhaite connaître le nom de la colonne.Une méthode simple pour y parvenir consiste à utiliser
colref << getname.
Voici une légère modification du script que vous avez fourni à l'aide de l'exemple de table de données JMP Candy Bars.jmp.
Names Default to Here(1);
//Open the JMP Sample Data table Candy Bars, create a 4x2 display
dt = Open("$Sample_Data/Candy Bars.jmp");
dt << select where(!Contains({"M&M/Mars","Hershey"}, :Brand) );
dt << delete rows();
:Brand << set name("Title");
x1col = Column(dt, "Carbohydrate g");
y1col = Column(dt, "Sugars g");
y2col = Column(dt, "Total fat g");
y3col = Column(dt, "Saturated fat g");
y4col = Column(dt, "Protein g");
candy_gb1 = dt << Graph Builder(
Variables(
X(x1col), Y(y1col), Y(y2col),Y(y3col),Y(y4col),
Group X( :Title )
),
Elements( Position( 1, 1 ), Line( X, Y ) ),
Elements( Position( 1, 2 ), Line( X, Y ) ),
Elements( Position( 1, 3 ), Line( X, Y ) ),
Elements( Position( 1, 4 ),
//Bar( X, Y, Legend( 36 ), Summary Statistic( "N" ) )
Bar( X, Y, Summary Statistic( "N" )) ),
SendToReport(
Dispatch(
{},
x1col<<GETNAME></GETNAME>