Let's say I need to script a graph. And I have a variable that is optional. I might have it, might not have it. Let's say in the example below I might have "Y_Parameter_Std" in the table, might not have it.
How do I script this optional variable?
gb = Graph Builder(
Size( 350, 200 ),
Show Control Panel( 0 ),
Variables( X( Column( X_Parameter ) ), Y( Column( Y_Parameter ) ), Overlay( :Wafer ID ), Interval( Column(Y_Parameter_Std) ) ),
Elements(
Points( X, Y, Legend( 14 ), Interval Style( "Band" ) ),
Smoother( X, Y, Legend( 15 ), Lambda( 0.1 ) ),
)
);
The way I'm going to try it is this:
Have script for the GB in an expression variable with a placeholder for Interval. If there is a column for interval - replace placeholder with the corresponding expression. If not - replace it with "".
Any other more elegant way?
Thanks,
M
In simple cases it is easiest to just use if-statement and two separate graph builder messages
Well, I have to feed column names into the GB expression anyways, they are not hardcoded, so might as well work on this too.
Just wondering which of the ways of dealing with expressions is the best.
I remember there was a post on them, maybe even by you, Jarmo, on common ways?
Hi @miguello ,
Might be worth looking a this post in the JSL cookbook it focuses on how to run platforms when the number or names of columns can change.
Thanks,
Ben
I have demonstrated them few times in community (if you manage to find the posts, not easy with community search), there is one related topic in scripters club and there are more posts also in community.
Scripters Club Recording: JSL in Graph Builder
Reply All: How to script dynamic content for Graph Builder
How do I use jsl add X variable to graphbuilder
Graph builder element loop function