Hola a todos
Tengo la siguiente parte de un script de entrada del usuario. El guión realmente funciona bien. El problema surgió cuando intenté agregar una línea de cuadrícula al gráfico con jsl, esa parte no parece funcionar. Intenté reemplazar X1 con x1col, Y1 con y1col (y así sucesivamente) pero parece que tampoco funciona. Cuando coloco el mouse sobre, por ejemplo, X1, se muestra la columna correcta. Sabía que puedo simplemente arrastrar y soltar, pero como trabajo en un gran conjunto de datos y genero gráficos, es bueno tenerlos automatizados. Por favor, indique cómo puedo superar este problema.
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 ) )} )
)
),Gracias.
Gracias gzmorgan0, funciona perfectamente!!
La declaración de envío del cuadro de escala de GraphBuilder quiere el nombre de la columna.Un método sencillo para hacerlo es utilizar
colref << obtener nombre.
Aquí hay una ligera modificación del script que proporcionó utilizando la tabla de datos de muestra 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>