Tengo una cadena almacenada en las Notas para una serie de columnas en una tabla y la he asignado al objeto "Notas". Cuando trazo estas columnas en un gráfico de variabilidad, me gustaría que las Notas aparecieran automáticamente como una anotación. Mi idea inicial era incluir de alguna manera la anotación en el gráfico original, pero creo que debería crear los gráficos y anotarlos después. ¿Alguna pista sobre cómo hacer esto? El código a continuación no funciona.
spud = Variability Chart( );
spud << Add Text Annotation(
Text( "Category: " || Notes ),
Fixed Size( 0 ),
Text Box( {1, -30, 382, 184} ),
Filled( 0 )
);Podría depender un poco de dónde desea agregar la anotación.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Variability Data/2 Factors Crossed.jmp");
obj = dt << Variability Chart(Y(:Measurement), X(:Operator, :part#));
report(obj) << Add Text Annotation(
Text("We need to discuss this at the next meeting."),
Text Box({65, 35, 200, 77})
);Esto funciona bien, pero necesita entradas predefinidas. Busco algo que permita seleccionar entradas y luego anotarlas.
Hago una copia de la interfaz del gráfico de variabilidad y la anoto desde allí. Probablemente necesite ajustes, pero parece funcionar.
Names Default To Here( 1 );
dt = Current Data Table();
If( !Namespace Exists( "Custom Dialog" ),
dialogRecallNS = New Namespace(
"Custom Dialog",
{
ycolRecall =
{
}
,
standRecall =
{
}
,
xcolRecall =
{
}
,
freqRecall =
{
}
,
partRecall =
{
}
,
byRecall =
{
}
}
)
,
dialogRecallNS = Namespace( "Custom Dialog" )
);
nc = N Col( dt );
lbWidth = 130;
pgm = Expr(
nw = New Window( "Annotated Multiple Plots",
For( i = 1, i <= N Items( exy ), i++,
Notes = Try( Column( dt, exy[i] ) << Get Property( "Notes" ) );
Try(
Variability Chart(
Y( exy[i] ),
X( Eval( exx ) ),
Standard( Eval( Standy ) ),
Freq( Eval( Freqy ) ),
By( Eval( Byy ) ),
SendToReport(
Dispatch(
{},
"",
AxisBox( 2 ),
Add Text Annotation(
Text( "Category: " || Notes ),
Fixed Size( 0 ),
Text Box( {0, -255, 0, 0} ),
Filled( 0 )
)
)
)
)
);
)
)
);
clearRoles = Expr(
colListY << RemoveAll;
colListX << RemoveAll;
Stand << RemoveAll;
Freq << RemoveAll;
Part << RemoveAll;
By << RemoveAll;
);
recallRoles = Expr(
dialogRecallNS:ycolRecall = colListY << GetItems;
dialogRecallNS:xcolRecall = colListX << GetItems;
dialogRecallNS:standRecall = Stand << GetItems;
dialogRecallNS:freqRecall = Freq << GetItems;
dialogRecallNS:partRecall = Part << GetItems;
dialogRecallNS:byRecall = By << GetItems;
);
customDlg = New Window( "Example of a Custom Dialog",
Border Box( Left( 3 ), top( 2 ),
V List Box(
H List Box(
V List Box(
Panel Box( "Select Columns",
colListData =
Filter Col Selector(
All,
width( lbWidth ),
nLines( Min( nc, 10 ) )
)
)
),
Panel Box( "Cast Selected Columns into Roles",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Y, Response",
colListY << Append( colListData << GetSelected )
),
colListY = Col List Box( width( lbWidth ), nLines( 5 ) ),
Button Box( "Standard",
Stand << Append( colListData << GetSelected )
),
Stand = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "X, Grouping",
colListX << Append( colListData << GetSelected )
),
colListX = Col List Box( width( lbWidth ), nLines( 2 ) ),
Button Box( "Freq",
Freq << Append( colListData << GetSelected )
),
Freq = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "Part, Sample ID",
Part << Append( colListData << GetSelected )
),
Part = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "By",
By << Append( colListData << GetSelected )
),
By = Col List Box( width( lbWidth ), nLines( 2 ) )
),
Text Box(
"Operator, Instrument are examples of possible Grouping Columns"
)
),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "OK",
recallRoles;
exy = colListY << get items;
exx = colListX << get items;
Standy = Stand << Get Items;
Freqy = Freq << Get Items;
Party = Stand << Get Items;
Byy = By << Get Items;
pgm;
customDlg << CloseWindow;
),
Button Box( "Cancel", customDlg << CloseWindow ),
Button Box( "Reset", clearRoles ),
Text Box( " " ),
Button Box( "Remove",
colListY << RemoveSelected;
colListX << RemoveSelected;
Stand << RemoveSelected;
Freq << RemoveSelected;
Part << RemoveSelected;
By << RemoveSelected;
),
Button Box( "Recall",
clearRoles;
Try(
colListY << Append( dialogRecallNS:ycolRecall );
colListX << Append( dialogRecallNS:xcolRecall );
Stand << Append( dialogRecallNS:standRecall );
Freq << Append( dialogRecallNS:freqRecall );
Part << Append( dialogRecallNS:partRecall );
By << Append( dialogRecallNS:byRecall );
);
)
)
)
)
)
)
);
colListx << set min items( 1 );
colListy << set min items( 1 );