Comandi JSL del Generatore di grafici su ElementsCiao,
Non riesco a trovare la sintassi per modificare (aggiungi elemento/rimuovi elemento/aggiungi etichette all'elemento) degli elementi del generatore di grafici Dopo il grafico è pronto.
Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Bar( X, Y, Legend( 2 ) ) )
);
//gb[Elementi(2)] << Etichetta( "Etichetta per valore" );// ?? // Qual è la sitassi per questo?
//gb << Aggiungi elemento(Posizione( 1, 3 ), Linea( X, Y, Legenda( 3 ) ));// ?? //Y deve essere il peso
Grazie
Personalizzazione di massaRi: Comandi JSL del Generatore di grafici su ElementsDal Jmp17 
Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y(1), Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Bar( X, Y(2), Legend( 2 ) ) )
);
gb << Update Element(1,2,1, {Label("Label by Value")});
gb << Add Variable({:weight, Role("Y"), Method("insert")}); //creates a bar chart
gb << Add Element( 1, 3 , {Type("Line"), X, Y}, Legend( 3 ) );
gb << Remove Element( 1, 3 , 1 ); //remove bar chartRi: Comandi JSL del Generatore di grafici su ElementsGrazie mille a entrambi.
"GraphBuilderBox" è la parola chiave...
Ri: Comandi JSL del Generatore di grafici su Elements@tom_abramov ,
Sono stato io, un errore di sintassi dell'utente.Lei va.
Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y(1), Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Bar( X, Y(2), Legend( 2 ) ) )
);
gbb = report(gb)[GraphBuilderBox(1)];
gbb<< Update Element(1,2,1, {Label("Label by Value")});
report(gb)[GraphBuilderBox(1)] << Add Variable({:weight, Role("Y"), Method("insert")}); //creates a bar chart
gbb = report(gb)[GraphBuilderBox(1)];
gbb << Add Element( 1, 3 , {Type("Line"), X, Y}, Legend( 3 ) );
gbb << Remove Element( 1, 3 , 1 ); //remove bar chart
Ri: Comandi JSL del Generatore di grafici su Elements@tom_abramov ,
Ho preso un percorso diverso, lungo, come Jim, @txnelson .Poi ho dovuto ridere, perché JMP ha una soluzione semplice con il messaggio
Aggiorna Element() inviato a GraphBuilderBox()
Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y(1), Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Bar( X, Y(2), Legend( 2 ) ) )
);
gbb = report(gb)[GraphBuilderBox(1)];
gbb<< Update Element(1,2,1, {Label("Label by Value")});
/* //hard way not recommended
//must be done while No Labels is specified
gb<< show Control Panel(1);
so_bar = report(gb)[OutlineBox("Bar[weight]")];
cb_label = so_bar << xpath("//ComboBox/ComboBoxItem[text()='No Labels']/..");
cb_label << set(2);
gb << show Control panel(0);
*/
Tuttavia, sto riscontrando un problema aggiungendo la variabile :weight, il che è facile da fare, ma per impostazione predefinita GraphBuilder crea un altro elemento del grafico a barre.e mi trovo in alcuni problemi complicati, diverse eccezioni JMP.
Aggiungerò un elemento della lista dei desideri per cui JMP consente un messaggio Cambia in() per gli elemnet, non solo Aggiungi elemento e Rimuovi elemento.
Aggiungerò al post quando/se lo capirò.
Ri: Comandi JSL del Generatore di grafici su Elements@tom_abramov
Mi è appena venuto in mente un pensiero e c'è un modo per aggirare questo problema... Questa è una soluzione che ho usato molte volte per ragioni diverse.Ciò che ti suggerisco di fare è scrivere il tuo codice, in modo che ciò che fai, quando devi aggiungere gli elementi a cui fai riferimento, elimini semplicemente l'intero grafico e lo ricrea al suo posto.Dal modo in cui JMP gestisce l'aggiornamento, probabilmente non mostrerà la modifica quando il grafico viene eliminato.Probabilmente vedrà solo che il grafico è cambiato.
Il codice seguente illustra la mia idea.
names default to here(1);
Open( "$SAMPLE_DATA/Big Class.jmp" );
new window("Test", vlb=vlistbox());
vlb<< append(gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 1 ) ) ),
Elements( Position( 1, 2 ), Bar( X, Y, Legend( 2 ) ) )
));
wait(5);
gb << delete;
vlb << append(gb = Graph Builder(
Size( 465, 278 ),
Show Control Panel( 0 ),
Fit to Window( "Off" ),
Variables( X( :age ), Y( :height ), Y( :weight ) ),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 1 ) ) ),
Elements(
Position( 1, 2 ),
Bar( X, Y, Legend( 2 ), Label( "Label by Value" ) )
)
));Ri: Comandi JSL del Generatore di grafici su ElementsMale per me...
Grazie Jim.
Ri: Comandi JSL del Generatore di grafici su ElementsNon penso che si possa fare.Quello che dovresti essere in grado di fare è passare a FrameBox() nell'output, un segmento, come un Bar Seg o un Line Seg.
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = Graph Builder( Variables( X( :age ), Y( :weight ) ), Elements( Bar( X, Y ) ) );
frame = Report( obj )[FrameBox( 1 )];
seg = (frame << Find Seg( "Bar Seg" ));
seg << Get Width Proportion();
seg << Set Fill Color( "Green" );
Puoi modificare i segmenti in modo interattivo, nella selezione Personalizza quando fai clic con il pulsante destro del mouse sul grafico e non è presente alcun segmento di etichetta.
