Hallo, ich versuche, Variablen zu meinem Graph Builder-Skript hinzuzufügen, damit ich eine Reihe von Diagrammen durchlaufen und sie alle gleich formatieren kann.
Kann mir jemand helfen, die Variablen richtig einzustellen? Ich bin mir nicht sicher, wo ich falsch liege, und kann online kein ähnliches Beispiel finden. Schätzen Sie jede Hilfe, die Sie leisten können.
Danke!
Graph Builder(
Size( 1081, 4190 ),
Variables(
X( :StartTime ),
Y( :Chamber Opened RFH, Side( "Right" ) ),
Y( :DP RFH, Position( 1 ), Side( "Right" ) ),
Y( :FR RFH, Position( 1 ), Side( "Right" ) ),
Y( :Upper Wall RFH, Position( 1 ), Side( "Right" ) ),
Y( :Wet Clean RFH, Position( 1 ), Side( "Right" ) ),
Y( :Name( "Step_Duration-19StepValue" ), Position( 1 ) ),
Page( :Tool_Chamber ID )
),
Elements(Points( X, Y( 6 ), Legend( 5 ) ),Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Y( 5 ), Legend( 7 ) )),
SendToReport(
For (i=2, i<=11, i++,
Dispatch({},"StartTime",ScaleBox( Expr(i) ),{Format( "m/d/y", 10 ), Min( 3586118400 ), Max( 3597955200 ),
Interval( "Month" ), Inc( 1 ), Minor Ticks( 0 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )}),
Dispatch({},"Step_Duration-19StepValue",ScaleBox( Expr(i) ),{Min( 40 ), Max( 50 ), Inc( 0.5 ), Minor Ticks( 1 ),
Add Ref Line( 48, "Dashed", "Medium Dark Red", "Max (48sec)", 2 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )} ),
);
For (i=1, i<=10, i++,
Dispatch({},"Chamber Opened RFH",ScaleBox( Expr(j) ),{Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 610.353515625 ), Inc( 50 ),Minor Ticks( 0 ), Label Row({Set Font Size( 14 ), Set Font Style( "Bold" )})}),
Dispatch( {}, "X title", Text Edit Box( Expr(j) ), {Set Text( "" )} ),
Dispatch( {}, "Y title", Text Edit Box( Expr(j) ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "SL Step 19 EPD (sec)" )} ),
Dispatch( {}, "Y r title", Text Edit Box( Expr(j) ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "RF Hrs" )} ),
);
Dispatch( {}, "400", LegendBox, {Legend Position( {5, [0], 7, [1, 2, 3, 4, 5]} ), Position( {0, 1, 2, 3, 4, 5} )})
)
);
Probieren Sie es aus:
Names default to here( 1 );
dt = Open( "$Sample_data/Australian Tourism.jmp" );
gb = dt << Graph Builder(
Size( 457, 6762 ),
Show Control Panel( 0 ),
Variables(
X( :Date ),
Y( :Persons Employed, Side( "Right" ) ),
Y( :Name( "Guest arrivals ('000)" ), Position( 1 ), Side( "Right" ) ),
Y( :Rooms, Position( 1 ) ),
Page( :Year )
),
Elements(
Points( X, Y( 3 ), Legend( 71 ) ),
Smoother( X, Y( 3 ), Legend( 72 ) ),
Points( X, Y( 1 ), Y( 2 ), Legend( 73 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Legend( 74 ) )
)
);
For( i=2, i<=15, i++,
gb << SendToReport(
Dispatch(
{},
"Date",
ScaleBox( i ),
{Min( 2934921600 ), Max( 3597609600 ), Interval( "Year" ), Inc( 1 ),
Minor Ticks( 3 ), Label Row( Show Major Grid( 1 ) )}
),
Dispatch(
{},
"Rooms",
ScaleBox( i ),
{Min( 70000 ), Max( 73000 ), Inc( 500 ),
Minor Ticks( 1 )}
),
Dispatch(
{},
"Persons Employed",
ScaleBox( i ),
{Min( -60000 ), Max( 80000 ), Inc( 10000 ),
Minor Ticks( 0 )}
),
Dispatch( {}, "X title", Text Edit Box( i - 1 ), {Set Text( "X Axis" )} ),
Dispatch( {}, "Y title", Text Edit Box( i - 1 ), {Set Text( "Left Y Axis" )} ),
Dispatch( {}, "Y r title", Text Edit Box( i -1 ), {Set Text( "Right Y Axis" )} )
)
);Hier sind einige zusätzliche Iterationen, die ich ausprobiert habe ...Einige sind auskommentiert.Keiner von ihnen wird funktionieren ... uh ...
dt = currentdatatable();
Graph Builder(
Size( 1081, 4190 ),
Variables(
X( :StartTime ),
Y( :Chamber Opened RFH, Side( "Right" ) ),
Y( :DP RFH, Position( 1 ), Side( "Right" ) ),
Y( :FR RFH, Position( 1 ), Side( "Right" ) ),
Y( :Upper Wall RFH, Position( 1 ), Side( "Right" ) ),
Y( :Wet Clean RFH, Position( 1 ), Side( "Right" ) ),
Y( :Name( "Step_Duration-19StepValue" ), Position( 1 ) ),
Page( :Tool_Chamber ID )
),
Elements(Points( X, Y( 6 ), Legend( 5 ) ),Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Y( 5 ), Legend( 7 ) )),
List= {"1","2","3","4","5","6","7","8","9","10"};
nList = N Items(List);
For (i=1,i <= nList, i++,
gb= Expr( SendToReport(
Dispatch({},"StartTime",ScaleBox( List[i]+1 ),{Format( "m/d/y", 10 ), Min( 3586118400 ), Max( 3597955200 ),
Interval( "Month" ), Inc( 1 ), Minor Ticks( 0 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )}),
Dispatch({},"Step_Duration-19StepValue",ScaleBox( List[i]+1 ),{Min( 40 ), Max( 50 ), Inc( 0.5 ), Minor Ticks( 1 ),
Add Ref Line( 48, "Dashed", "Medium Dark Red", "Max (48sec)", 2 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )} ),
Dispatch({},"Chamber Opened RFH",ScaleBox( List[i] ),{Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 610.353515625 ), Inc( 50 ),Minor Ticks( 0 ), Label Row({Set Font Size( 14 ), Set Font Style( "Bold" )})}),
Dispatch( {}, "X title", Text Edit Box( List[i] ), {Set Text( "" )} ),
Dispatch( {}, "Y title", Text Edit Box( List[i] ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "SL Step 19 EPD (sec)" )} ),
Dispatch( {}, "Y r title", Text Edit Box( List[i] ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "RF Hrs" )} ),
)
);
Eval(Substitute(Name Expr(gb),Expr(List[i]),List[i]));
);
/*List= {"1","2","3","4","5","6","7","8","9","10"};
nList = N Items(List);
For (i=1,i <= nList, i++,
gb= dt << SendToReport(
Dispatch({},"StartTime",ScaleBox( List[i]+1 ),{Format( "m/d/y", 10 ), Min( 3586118400 ), Max( 3597955200 ),
Interval( "Month" ), Inc( 1 ), Minor Ticks( 0 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )}),
Dispatch({},"Step_Duration-19StepValue",ScaleBox( List[i]+1 ),{Min( 40 ), Max( 50 ), Inc( 0.5 ), Minor Ticks( 1 ),
Add Ref Line( 48, "Dashed", "Medium Dark Red", "Max (48sec)", 2 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )} ),
Dispatch({},"Chamber Opened RFH",ScaleBox( List[i] ),{Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 610.353515625 ), Inc( 50 ),Minor Ticks( 0 ), Label Row({Set Font Size( 14 ), Set Font Style( "Bold" )})}),
Dispatch( {}, "X title", Text Edit Box( List[i] ), {Set Text( "" )} ),
Dispatch( {}, "Y title", Text Edit Box( List[i] ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "SL Step 19 EPD (sec)" )} ),
Dispatch( {}, "Y r title", Text Edit Box( List[i] ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "RF Hrs" )} ),);
Eval(Eval Expr(gb));
);*/
/*For (i=1, i<=10, i++,
gb= dt << SendToReport(
Dispatch({},"StartTime",ScaleBox( eval(i)+1 ),{Format( "m/d/y", 10 ), Min( 3586118400 ), Max( 3597955200 ),
Interval( "Month" ), Inc( 1 ), Minor Ticks( 0 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )}),
Dispatch({},"Step_Duration-19StepValue",ScaleBox( eval(i)+1 ),{Min( 40 ), Max( 50 ), Inc( 0.5 ), Minor Ticks( 1 ),
Add Ref Line( 48, "Dashed", "Medium Dark Red", "Max (48sec)", 2 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )} ),
Dispatch({},"Chamber Opened RFH",ScaleBox( eval(i) ),{Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 610.353515625 ), Inc( 50 ),Minor Ticks( 0 ), Label Row({Set Font Size( 14 ), Set Font Style( "Bold" )})}),
Dispatch( {}, "X title", Text Edit Box( eval(i) ), {Set Text( "" )} ),
Dispatch( {}, "Y title", Text Edit Box( eval(i) ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "SL Step 19 EPD (sec)" )} ),
Dispatch( {}, "Y r title", Text Edit Box( eval(i) ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "RF Hrs" )} ),);
Eval(Eval Expr(gb));
);*/
/*List= {"1","2","3","4","5","6","7","8","9","10"};
i=1;
gb= Expr( SendToReport(
Dispatch({},"StartTime",ScaleBox( List[i]+1 ),{Format( "m/d/y", 10 ), Min( 3586118400 ), Max( 3597955200 ),
Interval( "Month" ), Inc( 1 ), Minor Ticks( 0 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )}),
Dispatch({},"Step_Duration-19StepValue",ScaleBox( List[i]+1 ),{Min( 40 ), Max( 50 ), Inc( 0.5 ), Minor Ticks( 1 ),
Add Ref Line( 48, "Dashed", "Medium Dark Red", "Max (48sec)", 2 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )} ),
Dispatch({},"Chamber Opened RFH",ScaleBox( List[i] ),{Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 610.353515625 ), Inc( 50 ),Minor Ticks( 0 ), Label Row({Set Font Size( 14 ), Set Font Style( "Bold" )})}),
Dispatch( {}, "X title", Text Edit Box( List[i] ), {Set Text( "" )} ),
Dispatch( {}, "Y title", Text Edit Box( List[i] ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "SL Step 19 EPD (sec)" )} ),
Dispatch( {}, "Y r title", Text Edit Box( List[i] ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "RF Hrs" )} ),
)
);
Eval(Substitute(Name Expr(gb),Expr(List[i]),List[i]));*/
/*Expr(
gb= dt << SendToReport(
Dispatch({},"StartTime",ScaleBox( eval(i)+1 ),{Format( "m/d/y", 10 ), Min( 3586118400 ), Max( 3597955200 ),
Interval( "Month" ), Inc( 1 ), Minor Ticks( 0 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )}),
Dispatch({},"Step_Duration-19StepValue",ScaleBox( eval(i)+1 ),{Min( 40 ), Max( 50 ), Inc( 0.5 ), Minor Ticks( 1 ),
Add Ref Line( 48, "Dashed", "Medium Dark Red", "Max (48sec)", 2 ),Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )} ),
Dispatch({},"Chamber Opened RFH",ScaleBox( eval(i) ),{Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 610.353515625 ), Inc( 50 ),Minor Ticks( 0 ), Label Row({Set Font Size( 14 ), Set Font Style( "Bold" )})}),
Dispatch( {}, "X title", Text Edit Box( eval(i) ), {Set Text( "" )} ),
Dispatch( {}, "Y title", Text Edit Box( eval(i) ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "SL Step 19 EPD (sec)" )} ),
Dispatch( {}, "Y r title", Text Edit Box( eval(i) ), {Set Font Size( 14 ), Set Font Style( "Bold" ), Set Text( "RF Hrs" )} ),)
);
For (i=1, i<=10, i++,
Wait(1);
//Eval(Eval Expr(gb));
Eval(substitute(nameexpr(gb),Expr(gb),i));
);*/
Dispatch( {}, "400", LegendBox, {Legend Position( {5, [0], 7, [1, 2, 3, 4, 5]} ), Position( {0, 1, 2, 3, 4, 5} )})
);