H 목록 상자의 변수를 기반으로 그래프 빌더 제목을 설정할 수 있습니까?사용자가 매개변수를 입력할 수 있는 H 목록 상자 창이 있습니다. 그런 다음 몇 가지 계산을 수행하고 사용자에게 그래프 작성기를 제공합니다.
제 질문은 H 목록 상자의 매개변수를 기반으로 그래프 빌더 제목을 설정할 수 있습니까?입니다.아래는 샘플 코드입니다
Names Default To Here( 1 );
dt = current data table();
nw = New Window( "simulator",
H List Box( Text Box( " Input sample rate " ), sample rate = Number Edit Box() ),
H List Box( Text Box( " Input threshold " ), threshold = Number Edit Box() ),
Button Box( "OK",
thesamplerate = sample rate << get;
thethreshold = threshold << get;
numthreshold = num(thethreshold);
numtime = num(thetime);
//Here are more code I already finished based on above variable
Graph Builder(
Variables( X( :File Name ), Y( :greater ) ),
Elements( Bar( X, Y, Legend( 4 ) ) ),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Sample rate = Threshold = " )} //I want to have sample rate & threshold shown on title
)
)
)
))
자동화 및 스크립팅Re: H 목록 상자의 변수를 기반으로 그래프 빌더 제목을 설정할 수 있나요?제가 일반적으로 사용하는 방법은 다음과 같습니다.
Names Default To Here( 1 );
dt = Current Data Table();
nw = New Window( "simulator",
H List Box( Text Box( " Input sample rate " ), sample rate = Number Edit Box() ),
H List Box( Text Box( " Input threshold " ), threshold = Number Edit Box() ),
Button Box( "OK",
thesamplerate = sample rate << get;
thethreshold = threshold << get;
numthreshold = Num( thethreshold );
numtime = Num( thetime );
//Here are more code I already finished based on above variable
gb = Graph Builder( Variables( X( :File Name ), Y( :greater ) ), Elements( Bar( X, Y, Legend( 4 ) ) ) );
// Set the title
Report( gb )[Outline Box( 1 ), Text Edit Box( 1 )] << set text( "Sample Rate=" || Char( thesamplerate ) );
)
);Re: H 목록 상자의 변수를 기반으로 그래프 빌더 제목을 설정할 수 있나요?평가 삽입 또는 문자열 연결을 사용하여 제목을 작성할 수 있습니다.
여기에 하나의 옵션이 있습니다
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("simulator",
H List Box(Text Box(" Input sample rate "), sample rate = Number Edit Box()),
H List Box(Text Box(" Input threshold "), threshold = Number Edit Box()),
Button Box("OK",
thesamplerate = sample rate << get;
thethreshold = threshold << get;
//numthreshold = Num(thethreshold);
//numtime = Num(thetime);
gb = dt << Graph Builder(
Variables(X(:age), Y(:weight)),
Elements(Bar(X, Y, Legend(4)))
);
Report(gb)[TextEditBox(1)] << Set Text(Eval Insert("Sample rate = ^thesamplerate^ Threshold = ^thethreshold^"));
)
);
SendToReport의 제목에 직접 삽입할 수도 있습니다. 여기서는 제목 변수도 별도로 작성하지만 꼭 필요한 것은 아니지만 디버깅 등을 더 쉽게 만들 수 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("simulator",
H List Box(Text Box(" Input sample rate "), sample rate = Number Edit Box()),
H List Box(Text Box(" Input threshold "), threshold = Number Edit Box()),
Button Box("OK",
thesamplerate = sample rate << get;
thethreshold = threshold << get;
//numthreshold = Num(thethreshold);
//numtime = Num(thetime);
graph_title = Eval Insert("Sample rate = ^thesamplerate^ Threshold = ^thethreshold^");
gb = dt << Graph Builder(
Variables(X(:age), Y(:weight)),
Elements(Bar(X, Y, Legend(4))),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text(graph_title)} //I want to have sample rate & threshold shown on title
)
)
);
)
);Re: H 목록 상자의 변수를 기반으로 그래프 빌더 제목을 설정할 수 있습니까?두 분 모두 빠른 답변 감사드립니다