Vorrei utilizzare lo strumento Column Switcher in Graph Builder in modo che, selezionando una colonna all'interno dello strumento, la colonna corrispondente della tabella dati venga automaticamente impostata come "etichetta". Inoltre, dovrebbe rimuovere l'etichetta da tutte le colonne della tabella dati precedentemente etichettate che non sono più selezionate nello strumento Column Switcher. È possibile realizzare tutto ciò? Sto utilizzando JMP versione 19.
Utilizzando un gestore Make Column Switch, dovresti essere in grado di aggiungere il codice JSL necessario per apportare le modifiche desiderate quando viene utilizzato il selettore di colonne. Consulta l'indice degli script per una descrizione e un esempio del gestore Make Column Switch.
Grazie Jim. Ho adattato lo script di esempio presente nell'Indice degli script per "Crea gestore di cambio colonna" e questo codice sembra funzionare per quello che cercavo:
dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );
gb = Graph Builder( Variables( Y( :Process 1 ) ), Elements( Histogram( Y, Legend( 3 ) ) ) );
dt << Clear Column Selection();
columnSwitcher = gb << Column Switcher(
:Process 1,
{:Process 1, :Process 2, :Process 3, :Process 4, :Process 5, :Process 6, :Process 7}
);
dt << Set Label Columns();
dt << Set Label Columns( :Process 1 );
pre = Function( {currentColumn, nextColumn, switcher},
Print(
"Before switch: " || (currentColumn << get name) || " >> " || (nextColumn << get name) ||
" [Column Switcher] current: " || (columnSwitcher << Get Current)
);
currentColumn << Label( 1 );
);
post = Function( {previousColumn, currentColumn, switcher},
Print(
"After switch: " || (previousColumn << get name) || " >> " || (currentColumn << get name) ||
" [Column Switcher] current: " || (columnSwitcher << Get Current)
);
previousColumn << Label( 0 );
currentColumn << Label( 1 );
);
handler = columnSwitcher << Make Column Switch Handler( pre, post );