Hola, actualmente creé un cuadro de alineación con varios gráficos como 3 en él, y después de que apareció la ventana, quiero seleccionar cada gráfico por xpath y luego realizar algunas acciones como cambiar el tamaño o agregar una línea de referencia.
Sin embargo, descubrí que no puedo usar un bucle for para seleccionar individualmente los gráficos en mi cuadro de alineación, ¿qué debo hacer? ¡Gracias!
(Intenté usar gb1 = Graph Builder 1; gb2 = Graph Builder 2; gb3 = ... pero no creo que sea una forma efectiva).
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 );
);Si los agrega de esta manera, puede crear las referencias mientras los agrega (recopilarlos en una lista y no en variables separadas). Si desea utilizar XPath, puede hacer algo como
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;
Sin XPath por ejemplo
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);
Hola jthi,
¡Funciona! Realmente lo aprecio!