リストボックス内にプロット凡例が表示されないこんにちは、みんな、
だから私は関数を介して作成しているプロットに問題があります。機能は次のとおりです。
myRunChart = Function( {dt, y1, y2, y3, x, colour_col},
{Default Local},
dt << Control Chart(
Sample Label( Eval( x ) ),
KSigma( 3 ),
Chart Col( Eval( y1 ), Run Chart( Show Center Line( 0 ) ) ),
Chart Col( Eval( y2 ), Run Chart( Show Center Line( 0 ) ) ),
Chart Col( Eval( y3 ), Run Chart( Show Center Line( 0 ) ) ),
SendToReport(
Dispatch(
{Eval( "Run Chart of "|| y1 )},
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ), Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch( {Eval( "Run Chart of "|| y1 )}, "Control Chart Limits frame", FrameBox, {Frame Size( 69, 114 )} ),
Dispatch(
{Eval( "Run Chart of "|| y2 )},
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ), Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch( {Eval( "Run Chart of "|| y2 )}, "Control Chart Limits frame", FrameBox, {Frame Size( 69, 114 )} ),
Dispatch(
{Eval( "Run Chart of "|| y3 )},
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ), Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch( {Eval( "Run Chart of "|| y3 )}, "Control Chart Limits frame", FrameBox, {Frame Size( 69, 114 )} )
)
);
);
この関数を自分自身で呼び出すと、すべて問題ありません。プロットと凡例は通常通りプロットします。ただし、リストボックス内でこの関数を呼び出すと、凡例が削除され、グラフのサイズが変わります。
次のコードでは、ウィンドウ内でこの関数を2回呼び出しています。初めてHリストボックスの中に入って凡例が削除されたとき。しかし、関数の2回目の呼び出しは通常どおりに機能します。
nw2 = New Window("temp",
H list box(
rc2 = myRunChart(
dt_temp,
"column1",
"column2",
"column3",
time_col,
colour_col
)),
rc3 = myRunChart(
dt_temp,
"column4",
"column5",
"column6",
time_col,
colour_col
)
);
誰がどんな問題が起こり得るかについての考えを持っていますか?
リストボックスの内側にあるとき、プロット凡例は削除されます魅力的に働きます。ご協力ありがとうございました。これはあなたの時間のかなりの時間がかかったと確信しています。
大歓迎です、
ダビデ
リストボックスの内側にあるとき、プロット凡例は削除されますどうやら、Hリストボックス()内、またはアウトラインボックス()を使用したときでも、"Run Chart of"とy1、y2、またはy3変数の連結は実行されません。 文字列が正しく計算されるようにスクリプトを修正しました。その後、スクリプトは正しく完了します。
myRunChart = Function( {dt, y1, y2, y3, x, colour_col},
{Default Local},
Eval(
Substitute(
Expr(
dt << Control Chart(
Sample Label( Eval( x ) ),
KSigma( 3 ),
Chart Col( Eval( y1 ), Run Chart( Show Center Line( 0 ) ) ),
Chart Col( Eval( y2 ), Run Chart( Show Center Line( 0 ) ) ),
Chart Col( Eval( y3 ), Run Chart( Show Center Line( 0 ) ) ),
SendToReport(
Dispatch(
{ __y1__ },
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ),
Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch(
{ __y2__ },
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ),
Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch(
{ __y3__ },
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ),
Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
)
),
Expr( __y1__ ), "Run Chart of " || y1,
Expr( __y2__ ), "Run Chart of " || y2,
Expr( __y3__ ), "Run Chart of " || y3
)
);
Wait( 0 );
);
dt_temp = Open( "$SAMPLE_DATA\Solubility.jmp" );
Wait( 0 );
dt_temp << New Column( "Colour example" );
dt_temp:Colour Example << set formula( Modulo( Row(), 2 ) + 1 );
dt_temp << New Column( "Row Numbers" );
dt_temp:Row Numbers << set formula( Row() );
time_col = "Row Numbers";
colour_col = "Colour Example";
Wait( 0 );
nw2 = New Window( "temp",
H List Box(
"charts",
rc2 = myRunChart(
dt_temp,
"Chloroform",
"Benzene",
"Hexane",
time_col,
colour_col
)
),
rc3 = myRunChart(
dt_temp,
"Chloroform",
"Benzene",
"Hexane",
time_col,
colour_col
)
);リストボックスの内側にあるとき、プロット凡例は削除されますだから私はこのスクリプトを実行すると:
myRunChart = Function( {dt, y1, y2, y3, x, colour_col},
{Default Local},
dt << Control Chart(
Sample Label( Eval( x ) ),
KSigma( 3 ),
Chart Col( Eval( y1 ), Run Chart( Show Center Line( 0 ) ) ),
Chart Col( Eval( y2 ), Run Chart( Show Center Line( 0 ) ) ),
Chart Col( Eval( y3 ), Run Chart( Show Center Line( 0 ) ) ),
SendToReport(
Dispatch(
{Eval( "Run Chart of " || y1 )},
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ), Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch(
{Eval( "Run Chart of " || y2 )},
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ), Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch(
{Eval( "Run Chart of " || y3 )},
"Run Chart",
FrameBox,
{Frame Size( 436, 114 ), Row Legend(
Eval( colour_col ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
wait(0);
);
dt_temp = Open("C:\Program Files\SAS\JMP\14\Samples\Data\Solubility.jmp");
wait(0);
dt_temp << new Column ("Colour example");
dt_temp:Colour Example << set formula(modulo(row(),2) + 1);
dt_temp << new column ("Row Numbers");
dt_temp:Row Numbers << set formula(row());
time_col = "Row Numbers";
colour_col = "Colour Example";
wait(0);
nw2 = New Window( "temp",
H List Box( rc2 = myRunChart( dt_temp, "Chloroform", "Benzene", "Hexane", time_col, colour_col ) ),
rc3 = myRunChart( dt_temp, "Chloroform", "Benzene", "Hexane", time_col, colour_col )
);私はこの出力を得ます:
ご覧のとおり、凡例はHリストボックスの外側の関数呼び出しに対してのみ表示されます。

ログを参照してください。

この問題が発生したかどうか確認できますか。何が間違っている可能性がありますか?
リストボックスの内側にあるとき、プロット凡例は削除されますお返事ありがとうございます。
本当に?関数の両方の呼び出しは凡例付きのプロットを作成しましたか?
それは面白い。私はもっとよく見なければならないでしょう。おそらくそれはデータと関係があります。JMP 14も実行していますリストボックスの内側にあるとき、プロット凡例は削除されます私はJMP 14であなたのスクリプトを実行しましたが、何の問題も見ませんでした。