Ich würde eine bessere Programmierstruktur verwenden, um das zu erreichen, was Sie suchen.Die Referenzlinien können direkt auf das Diagramm angewendet werden, indem die Achsenobjekte in der Anzeigeausgabe geändert werden.Siehe unten:
gb = Graph Builder(
Size( 528, 457 ),
Show Control Panel( 0 ),
Variables( X( :Column (3) ), Y( :Column (4) ) ),
Elements( Points( X, Y, Legend( 3 ) )));
gbr = report(gb);
gbr[AxisBox(1)] << Add Ref Line( _LSL1_, "Solid", "Black", "xLSL", 1 );
gbr[AxisBox(1)] << Add Ref Line( _USL2_, "Solid", "Black", "xUSL", 1 );
gbr[AxisBox(2)] << Add Ref Line( _LSL2_, "Solid", "Black", "yLSL", 1 );
gbr[AxisBox(2)] << Add Ref Line( _USL2_, "Solid", "Black", "yUSL", 1 );
Einzelheiten zum Ändern der Anzeigebaumausgabe finden Sie im Skripthandbuch.Alle Nachrichten, die an die Anzeigeobjekte gesendet werden können, sind mit Definitionen und Beispielen im Scripting-Index aufgeführt.
Der erste Fall funktioniert gut, aber der zweite Fall, in dem die Achsennamen von außen bereitgestellt werden, funktioniert nicht. Wo mache ich einen Fehler?
Graph Builder(
Size( 528, 457 ),
Show Control Panel( 0 ),
Variables( X( :Column (3) ), Y( :Column (4) ) ),
Elements( Points( X, Y, Legend( 3 ) )),
SendToReport(
Dispatch(
{},
"Median 1",
ScaleBox,
{Add Ref Line( _LSL1_, "Solid", "Black", "xLSL", 1 ),
Add Ref Line( _USL2_, "Solid", "Black", "xUSL", 1 )}
),
Dispatch(
{},
"Median 2",
ScaleBox,
{Add Ref Line( _LSL2_, "Solid", "Black", "yLSL", 1 ),
Add Ref Line( _USL2_, "Solid", "Black", "yUSL", 1 )}
)
)
);zweiter Fall
xColName = Column Name( 3 ); show (xColName);
yColName = Column Name( 4 ); show (yColName);
Graph Builder(
Size( 528, 457 ),
Show Control Panel( 0 ),
Variables( X( :Column (3) ), Y( :Column (4) ) ),
Elements( Points( X, Y, Legend( 3 ) )),
SendToReport(
Dispatch(
{},
xColName, //"xColName"
ScaleBox,
{Add Ref Line( _LSL1_, "Solid", "Black", "xLSL", 1 ),
Add Ref Line( _USL2_, "Solid", "Black", "xUSL", 1 )}
),
Dispatch(
{},
yColName, //"yColName"
ScaleBox,
{Add Ref Line( _LSL2_, "Solid", "Black", "yLSL", 1 ),
Add Ref Line( _USL2_, "Solid", "Black", "yUSL", 1 )}
)
)
);