當您在資料過濾器中選擇一個項目時,我無法弄清楚如何進行「工作」。 當我選擇條件時,我希望腳本轉到我的限製表,然後填入我用於圖形腳本的表達式。 這將根據資料過濾器中的“where”語句而改變。 我不知道如何讓腳本觸發此操作,或者如果我要更改為不同的資料過濾器選擇,如何刪除它。 我提前道歉,因為我沒有完整的腳本或範例資料表。 如果需要更多信息,我會盡力獲取一些。
謝謝
// Step 1: Go to the textbox with "Where" statement
Try( test = Report( gb1_S.2 )[Text Box( 5 )] << Get Text );
graph = dt_lim << Get Rows Where( Contains( test, :SPEC_COL_NAMES ) );
// Step 2: If a condition exists, populate the following
f1 = Column( dt_lim, "StartF" )[graph][1]; // x1 for a Marker and starting point for the line
f2 = Column( dt_lim, "StartF" )[graph][2]; // x2 for a Marker and starting point for the line
s1 = (Column( dt_lim, "LSL" )[graph])[1]; // y1 (LSL) for the Line
s2 = (Column( dt_lim, "USL" )[graph])[1]; // y2 (USL) for the Line
color = "Red";
test = Expr(
graph_expr = Eval Insert(
"\[Graph_Script = Expr(
Marker Size( 6 );
Marker( Marker State( 20 ), Color State( "^color^" ), {^f1^, ^s1^}, {^f2^, ^s2^} );
Pen Color( "^color^" );
Line( {^f1^, ^s1^}, {^f2^, ^s2^} );
)]\"
);
Eval( Parse( graph_expr ) );
);
<BR /><BR />// Step 3: Execute the Graphics script<BR /><BR />Report( gb1_S.2 )[Framebox( 1 )] << Add Graphics Script( Graph_Script );查看腳本索引中的“製作過濾器更改處理程序”,以了解如何在更改過濾器選擇時觸發操作。
腳本索引範例:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
dist = Distribution(Automatic Recalc(1), Continuous Distribution(Column(:POP)));
filter = dist << Local Data Filter(Add Filter(columns(:Region)));
f = Function({a}, Print(a));
rs = filter << Make Filter Change Handler(f);