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 リスト ボックスの変数に基づいてグラフ ビルダーのタイトルを設定できますか?Eval Insert または文字列連結を使用してタイトルを作成できます。
ここに 1 つのオプションがあります
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 のタイトルに直接挿入することもできるはずです。 ここでは、title 変数も別途構築しますが、これは必須ではありませんが、デバッグなどを容易にすることができます。
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 リスト ボックスの変数に基づいてグラフ ビルダーのタイトルを設定できますか?お二人とも早速のご返答ありがとうございました