Ciao, al momento ho creato una casella di allineamento con diversi grafici, tipo 3, e dopo che si è aperta la finestra, voglio selezionare ogni grafico tramite xpath, quindi eseguire alcune azioni come ridimensionare o aggiungere una linea di riferimento.
Tuttavia ho scoperto che non riesco a usare un ciclo for per selezionare individualmente i grafici nella mia casella di selezione. Cosa dovrei fare? Grazie!
(Ho provato a usare gb1 = Graph Builder 1; gb2 = Graph Builder 2; gb3 = ... ma non credo che sia un metodo efficace.)
NW = New Window("GRA", LB = Lineup Box(N Col( 2 )));
LB << Append(
Graph Builder(
Variables(X,Y...
Graph Builder(
Variables(X,Y...
Graph Builder(
Variables(X,Y...
);
TotalGB = LB << xpath("//LineUpBox/Box"); # This is wrong for selecting graph object #
For( ii = 1, ii <= N Items(TotalGB), ii++,
TotalGB[ii] << Size( 800, 500 );
);Se li aggiungi in questo modo, potresti creare i riferimenti mentre li aggiungi (raccogliendoli in un elenco e non in variabili separate). Se desideri usare XPath puoi fare qualcosa come
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("", lub = Lineup Box());
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
gbs = (lub << XPath("//OutlineBox[@helpKey = 'Graph Builder']")) << get scriptable object;
senza XPath per esempio
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("", lub = Lineup Box());
gbs = {};
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
Insert Into(gbs, gb);
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
Insert Into(gbs, gb);
show(gbs);
Ciao jthi,
Funziona, lo apprezzo davvero!