Hi, I'm having a problem with scripting the column switcher from column variables obtained from GUI display boxes. My example here is with graph builder, but I tried another platform with similar results. I don't know if it is because of how I'm obtaining the column names (obj << get items()), so I've included all of that in the attached jsl. What should happen is graph builder should load with no errors, column "Y" should be in the Y role, and then "Y" plus my two added dummy columns "temp" and "temp2" should be in the column switcher. But in the first argument of Column Switcher(), it seems to only like having typed text in there. If I type the text "Y" or ":Y" it works fine, but I haven't found a way to massage my column variable containing "Y" in a way that it will work. When I use the variable, it throws an error.
Here's a snippet of the code, and I've attached a stripped down script that will open up sample data, generate a self populated GUI (just click OK), and you can see how just typing the column names will work, but my many attempts with variables will not. Am I doing something wrong, or is it a bug? If so, is there a workaround? I'm using JMP 11.2.0.
Note, this snippet is shown for reference only. If you want to run it, run the whole attached file. yParamNames is a list containing the parameters to be plotted. "Y" is the first column in this list.
Graph Builder(
Size( 570, 559 ),
Variables( X( column(dtDataOrig,tempName[1]) ), Y( column(dtDataOrig,yParamNames[1]) ), Overlay( column(dtDataOrig, partIdName[1]) ) ),
Elements(
Line( X, Y, Legend( 13 ), Row order( 0 ), Summary Statistic( "Mean" ) )
),
Column Switcher(
//"Y", // typing the text of the column name works
// does not work
//as column(dtDataOrig, Y),
//as column(:Y),
//as column(Y),
//column(Y),
//column(:Y),
yParamNames[1], // <---- I would think this would work, and would be the most straightforward implmentation, but can't get it to accept a variable.
yParamNames
)
);
Thanks,
Mike