Hi Everyone,
I am scripting in Application Builder. In one of my modules, I have a Graph Box, with the intention of setting it to display a pre-made graph, but I am not having much luck. I was originally thinking that the easiest thing to do would just be to somehow embed my pre-made graph into the module window, so I have been trying to use the Graph Box as a placeholder, trying something like:
graphBox << Visibility("Collapse");
panelBox << Append( /*graph*/ ) );
...but this has not been working. Potentially the easiest way is actually to script the different graph items into the Graph Box individually? I am pretty new to JSL so I know that my approach/syntax must be wrong in some way, but I am not sure what would be the best/easiest way to do this!
The code to create the graph I want (thanks to helpful users on another question that I posted) is:
Names Default To Here(1);
datafile = Open( "Data.xlsx" );
x_col = Column(datafile, 1);
y_cols = (datafile << Get Column Names())[2::N Cols(datafile)];
var_expr = EvalExpr(
Variables(X(Expr(x_col))
));
var_line = Expr(Line(X));
For Each({col, idx}, y_cols,
y_expr = Expr(Y(Position(1)));
Insert Into(y_expr, NameExpr(col), 1);
Insert Into(var_expr, Name Expr(y_expr));
yline_expr = Parse("Y("||char(idx)||")");
Insert Into(var_line, Name Expr(yline_expr));
);
graphbuild = Eval(Substitute(
Expr(
graphbuild = datafile << Graph Builder(
Size(838, 391),
Show Control Panel(0),
vvv,
Elements(yyy)
)
),
Expr(vvv), Name Expr(var_expr),
Expr(yyy), Name Expr(var_line)
));
/*gb_image = graphbuild << get picture;
graphbuild << Close Window;
New window("time-series plot",
gb_image
);*/
I commented out the last part of this code, because I actually prefer the resulting graph with the control panel simply suppressed ("Show Control Panel(0)"), as opposed to "<< Get Picture", because this hides the Graph Builder functionalities for the user, but still allows for a dynamic graph (grabbable and moveable axes, etc.). If it is possible to embed the graph in this way, then that is my ideal route.
I appreciate any help.
Thank you,
Estelle