The First chunk of code is how ill like it to work but it doesnt.
The Second chunk of code works if i replace Variables( vars ) with it
Is there a way to get the First chunk working? Please advise if im doing something wrong here thankyou. JMP16
//Define variables for X, X1, X2, Y, Y1, Y2, and Group X
vars = {X(colX[i]), X(colX1[i], Position( 1 )), X(colX2[i], Position( 1 )),
Y(colY[i]), Y(colY1[i], Position( 1 )), Y(colY2[i], Position( 1 ))
};
//If colGroupX[i] is not missing, add Group X statement to the variables block
If( Is Missing(colGroupX[i]) != 1,
vars = Insert Into( vars, Group X( colGroupX[i] ) )
);
// Graph builder code where vars is inserted into the variables
GB = Current Data Table() << Graph Builder(
Size( 1413, 999 ),
Variables( vars ), // vars is placed here
Elements(
Points( X( 1 ), X( 2 ), X( 3 ), Y( 1 ), Y( 2 ), Legend( 11 ) ),
Smoother( X( 1 ), X( 2 ), Y( 3 ), Y( 1 ), Y( 2 ), Legend( 14 ) )
),
SendToReport(
Dispatch(
{},
"Graph",
ScaleBox,
{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
)
)
);
Variables(
X(colX[i]),
X(colX1[i], Position( 1 )),
X(colX2[i], Position( 1 )),
Y(colY[i]),
Y(colY1[i], Position( 1 )),
Y(colY2[i], Position( 1 ))
),