¿Cómo implementa JSL un valor de variable de hacer clic para obtener en un gráfico de este tipo?Siga el guión a continuación.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
);
¿Cómo escribir JSL? ¿Cómo lograr en el gráfico hacer clic en una determinada barra de edad para obtener este valor de edad? Y utilizar este valor para realizar operaciones posteriores.
¡Gracias!

Análisis y modelado de datos básicosCompartir y comunicar resultadosEjemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?Si hace clic en el espacio indicado por esta flecha, ¿puede obtener el valor de edad = 14?
Es un clic izquierdo del mouse, no etiquetas flotantes.
Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico???
frame = (p1 << report)[FrameBox( 1 )];
frame << Set Graphlet(
Picture(
dataage = Parse( age:_where );//??
d2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
d2 << Select Where( age == dataage );
d3 = d2 << Subset( Output Table( "test" ), Selected Rows( 1 ), selected columns( 0 ) );
Try( d3 << Delete Table Property( "Source" ) );
),
Reapply( 1 )
);
Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?
Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?Si se activa con Hover Labels, ¿por qué solo se puede activar para abrir Big Class Families.jmp a la edad == 12?
¡Gracias!
txt = "a";
Set Clipboard( txt );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
,
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
Set Textlet(
Setup(
expr = Parse( local:_where );
a = local:_dataTable << Get Rows Where( expr );
Set Clipboard( a[1] );
local:r = local:_dataTable << Get Rows Where( expr );
),
Markup( "{local:r}rows" )
)
)
)
);
txt = Get Clipboard();
frame = (p1 << report)[FrameBox( 1 )];
frame << Set Graphlet(
Picture(
dataage = txt; //Parse( age:_where );//??
d2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
d2 << Select Where( age == dataage );
d3 = d2 << Subset( Output Table( "test" ), Selected Rows( 1 ), selected columns( 0 ) );
Try( d3 << Delete Table Property( "Source" ) );
),
Reapply( 1 )
);
Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?dt = Open( "$SAMPLE_DATA/Big Class.jmp", invisible );
p1 = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
);
// this graphbuilder chart has multiple FrameBoxes. Get a list of them.
framelist = Report( p1 ) << XPath( "(//OutlineBox[text()='Graph Builder']//FrameBox)" );
// each framebox needs a graphis script with a Mousetrap to detect clicks.
For( iFrame = 1, iFrame <= N Items( framelist ), iFrame += 1,
frame = framelist[iFrame];
// the mousetrap needs to capture the iFrame value when it is
// built so it can report it later; use eval(evalexpr(...expr()...))
Eval(
Eval Expr(
frame << Addgraphicsscript(
Mousetrap(
{/*nothing on mouse drag, it happens a lot*/}//
, // but on mouse up, do something. MouseUp only happens once per click.
xx = x;
yy = y;
Show( xx, yy, Expr( iFrame ) );
// run your script here
)
)
)
);
);Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?¡Gracias expertos!
Muy sorprendente, he visto cambios xx, yy y Expr(iFrame).

Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?Pero ¿por qué este script no funciona en la versión china de JMP Pro 17.0?
ganar10
¡Gracias!

Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?Configure mi versión 17 de JMP en inglés.
Funciona, pero ¿habrá chino en el registro?
¡Gracias!

Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?DE ACUERDO
¡Gracias Craige!
Me enseñaste cómo resolver problemas para no simplemente copiar código.
¡Gracias expertos!

Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?agarré esto
"(//OutlineBox[text()='Graph Builder']//FrameBox)"
de aquí
right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.Haga clic con el botón derecho en el triángulo de contorno y elija Mostrar propiedades. Haga clic en uno de los gráficos.
podrías simplificarlo a
framelist = Report( p1 ) << XPath( "(//FrameBox)" );
Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?Todavía quiero activar secuencias de comandos haciendo clic en los gráficos, no mediante etiquetas flotantes
Pero este gráfico cambia de forma y no sé cómo cambiarlo para escribir JSL.
Tuve que volver a los expertos.
¡Gracias!

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Size( 632, 1152 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements(
Bar( X, Y, Legend( 5 ), Bar Style( "Stacked" ), Response Axis( "X" ), Summary Statistic( "Sum" ) )
)
);
gp = Report(p1)["Graph Builder",FrameBox(1)]
Eval(
Eval Expr(
gp << Addgraphicsscript(
Mousetrap(
{},
a0 = Expr( iFrame );
dt << Select Where( :height == a0 );
dt << Select Columns( "height" );
d3 = dt << Subset( Output Table( "test" ), Selected Rows( 1 ), columns( height ) );
)
)
)
);Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?y si eres demasiado vago para ir a los bares, simplemente
- agregar un gráfico HeatMap
- con variables x e y deshabilitadas
- y transparencia establecida en 0:
Ejemplo: ¿Cómo implementa JSL un valor de variable de hacer clic para obtener en dicho gráfico?Para aquellos que son demasiado vagos para hacer clic, o demasiado vagos para usar el manejo de expresiones: usen la parte Imagen de la etiqueta Hover.
La reacción es inmediata (mucho más rápida que el tiempo que lleva hasta que aparece la etiqueta flotante).
dt = Open( "$SAMPLE_DATA/Big Class.jmp", invisible );
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
);
fbs = Report( gb ) << XPath( "//FrameBox" );
For Each( {fb}, fbs,
fb << Set Graphlet( Picture( Caption( Char( myAge = :age[local:_firstRow] ) ) ) )
);Pregunta: ¿Cómo implementa JSL un valor de variable de tipo "haga clic para obtener" en un gráfico de este tipo?