Plotlegende wird entfernt, wenn sie sich in einem Listenfeld befindetHallo zusammen,
Ich habe also ein Problem mit einer Handlung, die ich über eine Funktion erstelle. Die Funktion ist wie folgt:
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 )} )
)
);
);
Wenn ich diese Funktion von selbst anrufe, ist alles in Ordnung. Plot und Legende werden wie üblich dargestellt. Wenn ich jedoch die Funktion innerhalb eines Listenfelds aufrufe, wird die Legende entfernt und die Größe der Diagramme geändert.
Im folgenden Code rufe ich die Funktion zweimal in einem Fenster auf. Das erste Mal ist es in einem H-Listenfeld und die Legende wird entfernt. Der zweite Aufruf der Funktion funktioniert jedoch normal.
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
)
);
Hat jemand eine Idee was das Problem sein könnte?
Re: Plot Legend wird entfernt, wenn Sie sich in einem Listenfeld befindenFunktioniert einen Zauber. Danke für deine Hilfe. Ich bin sicher, dass das ziemlich viel Zeit gekostet hat.
Es wird sehr geschätzt,
David
Re: Plot Legend wird entfernt, wenn Sie sich in einem Listenfeld befindenOffensichtlich wird aus dem H-Listenfeld () oder selbst bei Verwendung eines Gliederungsfelds () die Verkettung von "Diagramm ausführen" und der Variablen "y1", "y2" oder "y3" nicht durchgeführt. Ich habe das Skript überarbeitet und die Zeichenfolge korrekt berechnet. Das Skript wird dann ordnungsgemäß abgeschlossen
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
)
);Re: Plot Legend wird entfernt, wenn Sie sich in einem Listenfeld befindenWenn ich also dieses Skript starte:
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 )
);Ich bekomme diese Ausgabe:
Wie Sie sehen, wird die Legende nur für den Funktionsaufruf außerhalb des H-Listenfelds angezeigt.

Siehe Protokoll:

Können Sie bestätigen, wenn Sie dieses Problem sehen? Irgendwelche Ideen, was könnte falsch sein?
Re: Plot Legend wird entfernt, wenn Sie sich in einem Listenfeld befindenDanke für Ihre Antwort.
"Ja wirklich?" Beide Aufrufe der Funktion erzeugten ein Diagramm mit einer Legende?
Das ist interessant. Ich muss genauer hinsehen. Vielleicht hat es etwas mit den Daten zu tun. Ich führe auch JMP 14 ausRe: Plot Legend wird entfernt, wenn Sie sich in einem Listenfeld befindenIch habe Ihr Skript in JMP 14 ausgeführt und konnte keine Probleme feststellen.