Salut,
L'objet "GraphBuilder" ne peut pas être envoyé à un Journal. Vous devez récupérer le rapport : rapport (obj) << Journal ;
De plus, il n'est pas clair si vous essayez de fermer le Journal ou de fermer l'Obj avec la dernière instruction de votre script. Je recommande de séparer ces deux étapes.
Meilleur,
TS
Je ne vois pas ce problème avec cet exemple simple des étapes de votre processus :
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
obj << Journal;
obj << Close Window;
Voici un code qui génère cette erreur.Pourquoi cela se produit-il ?Je n'ai aucune idée.
//Fan Statuses vs. Occupancy graphs
For( j = 1, j <= N Items( var ), j++, //Outer loop to cycle within list of variables
v1 = Char( "Time " || var[j] || "_FanStatus" );
v2 = Char( var[j] || "_FanStatus" );
obj = Graph Builder(
Size( 1400, 800 ),
Variables(
X( Column( v1 ) ),
X( :Time Final, Position( 1 ) ),
Y( Column( v2 ) ),
Color( :Occupancy )
),
Elements(
Line( X( 1 ), Y, Color( 0 ), Legend( 2 ), Connection( "Step" ) ),
Heatmap( X( 2 ), Legend( 3 ) )
),
SendToReport(
Dispatch( {"Line"}, "", OutlineBox, {Close( 0 )} ),
Dispatch( {"Heatmap"}, "", OutlineBox, {Close( 0 )} ),
Dispatch(
{},
v1,
ScaleBox,
{Min( :Time Final[1] ), Max( :Time Final[N Rows( :Time Final )] ), Interval( "Minute" ),
Inc( 15 ), Minor Ticks( 0 ), Label Row( Label Orientation( "Angled" ) )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
3,
Properties( 0, {Transparency( 0.5 )}, Item ID( "Occupied", 1 ) ),
Properties( 1, {Fill Color( 4 ), Transparency( 0.5 )}, Item ID( "OptStart", 1 ) ),
Properties( 2, {Fill Color( 2 ), Transparency( 0 )}, Item ID( "Unoccupied", 1 ) )
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Raney " || v2 || " vs. Occ" )} )
)
);
obj << Journal << Close Window;
);