안녕,
(컨텍스트에 대한 참고 사항: 데이터 세트(첨부된 스크립트 참조)의 각 레이블(A, B, C, D 및 E)에 대한 그래프를 만든 다음 동일한 출력 창에 추가하는 것을 자동화하는 그래프 템플릿을 작업 중입니다. 쉽게 내보내고 공유할 수 있습니다. 여기에서는 "A" 레이블에 대한 단일 그래프를 사용하여 스크립트에 무엇이 잘못되었는지 증명하고 있습니다. )
JMP 스크립트가 모달 창의 사용자 선택에서 선택한 Group-by 변수를 읽지 못하는 문제가 있었습니다. 사용자가 데이터에서 "그룹화 기준" 열 이름을 선택하기를 원합니다. 이 열 이름은 모든 그룹화 기준 변수가 될 수 있고 아래 예와 같이 범례와 채색 구성표가 있습니다.

첨부된 JMP 데이터 테이블에서 내 장난감 데이터에는 일반 "그룹" 열이 있습니다. 그러나 사용자는 테이블에서 임의의 문자 변수(예: 제조 사이트, 배치, 프로세스, 제형)를 선택할 수 있어야 하며 그룹별 범례 및 색상 구성표를 가질 수 있어야 합니다.
내 JMP 스크립트는 다음과 같습니다.
//select the data in the original data table
Names Default To Here( 1 );
dt = Current Data Table();
/*
2/28/2022 Edit
get column names to
1. get x-axis variable
2. get grouping variable for coloring the dots
- needs to be a none option for when there is no group
- logic statement later if set_groupby is "none", then no
-
Also, ask user what coloring scheme should be used.
JMP auto color (blue and red) or none (if manually coloring by, for example, batch ID)
see source: https://www.jmp.com/support/help/zh-cn/15.2/index.shtml#page/jmp/get-column-names.shtml
*/
column_names = dt << Get Column Names( Numeric, character, String );
//TO DO:
//names_for_groupby_select =
//group by should be a character variable only, so
<FONT color="#FF0000">groupby_col_names = dt << Get Column names(character, String);</FONT>
nw1 = New Window("Set X-axis and group by variable",
<<MODAL>groupby_col = Radio Box(groupby_col_names),
H List Box(
Button Box("OK",
answers = Eval List({set_xlabel = xaxisselect << get selected,
<FONT color="#FF0000">set_groupby = groupby_col << get selected</FONT>
});
nw1 << close window;
),
Button Box("Cancel")),
//change popup window size
<<SIZE window=""> 9, 5);
// generic chart (can be control chart or process chart)
Oneway(
SendToByGroup( {:Name("Label (y-axis)") == label_val},
Y( :Result ),
X( char(set_xlabel) ), //:Name("x axis") ),
Connect Means( 1 ),
Grand Mean( 0 ),
SendToReport(
Dispatch(
{},
"Result",
TextEditBox,
{Set Text( label_val || units_formatted )}
),
//font size:
Dispatch(
{},
"2",
ScaleBox,
{Label Row( Set Font Size( font_size ) )}
),
//graph stuff:
Dispatch(
{},
"Oneway Plot",
FrameBox,
{Frame Size( 1000, 300 ), DispatchSeg(
CustomStreamSeg( 6 ),
{Line Color( "Gray" )}
),
<FONT color="#FF0000">Row Legend(
//group by this
//:Name("Group"), //or just Group works too
char(set_groupby), // << need to be specified by user.
//set_groupby, // TO DO: fix this bug!</FONT>
Color( 1 ),
Color Theme( "JMP default" ), // TO DO: << needs to be specified by user.
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
)
);
);
container << Append(content)
);</SIZE></MODAL>
이 JMP 스크립트에서는 x축 열 선택이 작동하므로(아래의 모달 창 예제 및 결과 그래프 참조) group-by 변수 참조도 작동한다고 가정했습니다. 그러나 출력은 그룹화 기준 변수나 범례가 없는 그래프를 생성합니다. 내 코드가 여기서 잘못하고 있는 것은 무엇입니까?
모달 창:

레이블 "A"에 대한 JMP 출력 예시 그래프

나는 문제를 통해 이 게시물.
char(set_groupby)에 대해 Column(listDT,set_groupby)을 사용합니다.
Row Legend(
//group by this
Column(listDT,set_groupby),
Color( 1 ),
Color Theme( "JMP default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}Eval()을 사용할 수도 있습니다
Row Legend(
//group by this
Eval(set_groupby),
Color( 1 ),
Color Theme( "JMP default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}