Estimados:
quiero crear un grafico paralelo
El eje X es parte de la columna de la tabla.
Cómo crear usando jsl
También intento agregar variable() pero no puedo funcionar.
gracias
<< Agregar variable debería funcionar, pero algunos casos pueden ser más complicados
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:weight), X(:height, Position(1))),
Elements(Parallel(X(1), X(2), Legend(9)))
);
wait(1); // for demo purposes
gb << Add Variable({:age, Role("X"), Position(1)});
Gracias,
¿Tienes otra pregunta?
Ahora puedo usar Agregar variable para agregar variables X al generador de gráficos.
pero no se puede cambiar a gráfico paralelo para agregar la variable X (automático) mediante el uso de Agregar elemento
Por favor consulte el archivo adjunto
gracias
Names Default To Here(1);
dt=Current Data Table();
colnames=dt<< get column names( "character" );
remove from(colnames,nitems(colnames));
remove from(colnames,1);
variables_expr = Expr(Variables(X(:X__1)));
gb = dt << Graph Builder(
Size( 1854, 917 ),
Show control Panel(0),
Variables(X(:X__1)),
Color( :color ),
Size( :Amt )
);
gb << inval;
For Each({x_col, idx}, colnames,
Eval(EvalExpr(
gb << Add Variable({Expr(Name Expr(As Column(dt, x_col))), Role("X"),position(1)})
));
);
<FONT color="#0000FF">// question</FONT>
<FONT color="#0000FF">gb << Add Element( 1, 1, {Type( "Parallel" ),Legend( 4 ),Combine Sets( 1 )} );</FONT>
gb << Update window;
Si construyes la trama paralela a mano y revisas el guión
Graph Builder(
Size(490, 448),
Show Control Panel(0),
Variables(
X(:X__1),
X(:X__2, Position(1)),
X(:X__3, Position(1)),
X(:X__4, Position(1)),
X(:X__5, Position(1))
),
Elements(Parallel(X(1), X(2), X(3), X(4), X(5), Legend(18)))
)
y luego compárelo con su script (compilelo y luego obtenga el script del menú de triángulo rojo)
Graph Builder(
Size(1854, 917),
Show Control Panel(0),
Variables(
X(:X__1),
X(:X__2, Position(1)),
X(:X__3, Position(1)),
X(:X__4, Position(1)),
X(:X__5, Position(1))
),
Elements(
Points(X(1), X(2), X(3), X(4), X(5), Legend(5)),
Parallel(Legend(4), Combine Sets(1))
)
)
Hay algunas diferencias importantes: todavía te quedan puntos y simplemente no has definido X() en tu script.
Si esto es lo que desea hacer, le sugeriría construir la expresión del generador de gráficos y no usar << Agregar variable y << Agregar elemento, ya que puede ser más fácil.
Names Default To Here(1);
dt = Current Data Table();
colnames = dt << get column names("character");
Remove From(colnames, N Items(colnames));
Remove From(colnames, 1);
variables_expr = Expr(Variables(X(:X__1)));
parallel_expr = Expr(Parallel(X(1)));
For Each({colname, idx}, colnames,
xpart = EvalExpr(X(Expr(NameExpr(AsColumn(dt, colname))), Position(1)));
Insert Into(variables_expr, Name Expr(xpart));
Eval(EvalExpr(
Insert Into(parallel_expr, Name Expr(X(Expr(idx + 1))));
));
);
Insert Into(parallel_expr, Name Expr(Legend(18)));
elements_expr = Expr(Elements());
InsertInto(elements_expr, NameExpr(parallel_expr));
gb = Eval(Substitute(
Expr(dt << Graph Builder(
Size(1854, 917),
Show control Panel(0),
_variables_,
_elements_,
Color(:color),
Size(:Amt)
)),
Expr(_variables_), Name Expr(variables_expr),
Expr(_elements_), Name Expr(elements_expr)
));