對錶格框中的列進行條件格式設置您好 - 我想將單個條件格式規則應用於錶框中的兩列數據。 我在下面設置了一個使用 Big Class 數據集的示例來說明問題,其中我可以輕鬆地在數據表中執行我想要的操作,但在錶框中產生相同的效果似乎有點棘手。
為表格框的列創建條件格式的機制與數據表所需的機製完全不同,並且要求我在首選項中設置規則,如圖所示。 這部分很簡單,但我看不到一種方法將該規則應用於與該規則直接相關的列以外的列。 能做到嗎?
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
// Color-code blue all pupils whose height is at least 60, with everybody else purple;
// First color every cell in both the name and height columns purple;
Column( dt, "name" ) << color cells( RGB Color( 255, 0, 255 ), Index( 1, N Row( dt ) ) );
Column( dt, "height" ) << color cells( RGB Color( 255, 0, 255 ), Index( 1, N Row( dt ) ) );
// Now find everybody whose height is at least 60, and color them blue;
CellsToPaint = dt << get rows where( :Height >= 60 );
Show( CellsToPaint );
// Color them all blue;
Column( dt, "name" ) << color cells( RGB Color( 100, 100, 255 ), CellsToPaint );
Column( dt, "height" ) << color cells( RGB Color( 100, 100, 255 ), CellsToPaint );
// Now I'll try to produce the same effect with those two columns in a table box;
// Create a copy of the Big Class data table in a table box;
My_TB = Table Box( <<SET shade="" alternate="" rows=""></SET>
回复:對錶格框中的列進行條件格式設置非常感謝吉姆 - 這太巧妙了!
僅供記錄,我在下面添加了原始腳本的修改版本的副本,其中包含您關於如何解決此問題的建議。 再次感謝 - 這對我來說非常有用。
Clear Log();
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
// Color-code blue all pupils whose height is at least 60, with everybody else purple;
// First color every cell in both the name and height columns purple;
Column( dt, "name" ) << color cells( RGB Color( 255, 0, 255 ), Index( 1, N Row( dt ) ) );
Column( dt, "height" ) << color cells( RGB Color( 255, 0, 255 ), Index( 1, N Row( dt ) ) );
// Now find everybody whose height is at least 60, and color them blue;
CellsToPaint = dt << get rows where( :Height >= 60 );
Show( CellsToPaint );
// Color them all blue;
Column( dt, "name" ) << color cells( RGB Color( 100, 100, 255 ), CellsToPaint );
Column( dt, "height" ) << color cells( RGB Color( 100, 100, 255 ), CellsToPaint );
// Now I'll produce the same effect with those two columns in a table box using Jim's suggestion;
// Export it to the journal as a data table, which converts it into a TableBox in the process;
dt << journal;
// Pull it back again as a TableBox, putting into a window with any other objects that I might want to incorporate;
nw = New Window( "My Window",
Lineup Box( N Col( 1 ),
Text Box( "Clever, huh?" ),
Border Box( Current Journal()[Table Box( 1 )], <<SIDES></SIDES>
回复:對錶格框中的列進行條件格式設置我沒有可以創建條件格式規則的解決方案。 然而,我已經完成了你想要的,通過將彩色數據表移動到日記中,然後將 TableBox(1) 從該日記附加到我正在創建的應用程序中
