<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSL - Check box to select variable to then plot in graph builder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244498#M48167</link>
    <description>ok, makes sense. Even then you could use the column dialog, though you then need to slightly adjust your script to have the correct variable name used. The nice thing is you can use a self defined variable name you want to use in your script further on and remuve the dependency on the table variable names. You still can do an if_else structure, but instead of :age you can use your own name which makes the script more general and usually then also more robust.</description>
    <pubDate>Fri, 31 Jan 2020 15:05:38 GMT</pubDate>
    <dc:creator>martindemel</dc:creator>
    <dc:date>2020-01-31T15:05:38Z</dc:date>
    <item>
      <title>JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244418#M48150</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make a script which would work this way:&lt;/P&gt;&lt;P&gt;1. Opens a new window showing "Select the parameters you want to plot" with a list of parameters with check box for each, and the operator would chose which ones he wants to plot by ticking them.&lt;/P&gt;&lt;P&gt;2. Then for the ones that are ticked, open a graph builder with the corresponding variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently able to make the first step (new window and list with check boxes), and I know how to script to create a graph, but I miss the link between them ...&amp;nbsp;I was initially thinking of calling each check box indivudally and then do a succession of "if" like "if cb1 is ticked, then do the graph, if not, then if cb2 is ticked etc ...". I tried the following script to train but it always displays "Failed" in the end no matter if I ticked the box, so it does not really check the box:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

New Window( "Choose the parameters to be plotted", 
cb1 = Check Box ("Parameter 1",0),
cb2 = Check Box ("Parameter 2",0)
);

wait(5);

If (cb1 == 1,
Graph Builder(
	Variables(
		X( :Name( "Process duration" ) ),
		Y( :Name( "Parameter 1" ) )	)	),

New Window( "Failed"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Do you have any idea how to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2742"&gt;@martindemel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 12:36:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244418#M48150</guid>
      <dc:creator>Elofar</dc:creator>
      <dc:date>2020-01-31T12:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244451#M48156</link>
      <description>&lt;P&gt;When prompting for input in a dialog, here are two common ways to do things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Use a modal dialog to pause the execution of the script while waiting for input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt=Open("$SAMPLE_DATA/Big Class.jmp");
// Prompt for the input
rc = New Window("Choose the parameters to be plotted",
	&amp;lt;&amp;lt;Modal, &amp;lt;&amp;lt;Return Result,
	rb = Radio Box({"weight", "height"})
);&lt;BR /&gt;// Launch report if Ok was pressed
if (rc["Button"] == 1,
	// Ok pressed
	Choose (rc["rb"],
		Graph Builder(Variables(X(:age), Y(:weight))),
		Graph Builder(Variables(X(:age), Y(:height)))
	);
	,
	// Cancel
	"Cancel"
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In your script, variable "cb1" is a DisplayBox.&amp;nbsp; In this example, the &amp;lt;&amp;lt;Return Result option turns all of the display box information into result data.&amp;nbsp; In a modal dialog the boxes are deleted before execution continues, so this is important!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Do the "action" part of the dialog as part of a button script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt=Open("$SAMPLE_DATA/Big Class.jmp");
// Prompt for the input and create graph
rc = New Window("Choose the parameters to be plotted",
	rb = Radio Box({"weight", "height"}),
	Button Box("Ok",
		Choose(rb&amp;lt;&amp;lt;Get,
			Graph Builder(Variables(X(:age), Y(:weight))),
			Graph Builder(Variables(X(:age), Y(:height)))
		);
		rb&amp;lt;&amp;lt;Close Window;
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A modal dialog will block all other input to other windows, while the second approach would allow you to continue using other windows in JMP at the same time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 13:46:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244451#M48156</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2020-01-31T13:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244458#M48157</link>
      <description>&lt;P&gt;That seems promising thanks a lot !! However in what you suggested, it's either one box or the other but not both, whereas I would like to have as many boxes ticked as required ... What should I change in your scripts?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 13:53:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244458#M48157</guid>
      <dc:creator>Elofar</dc:creator>
      <dc:date>2020-01-31T13:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244470#M48160</link>
      <description>&lt;P&gt;In that case you can keep the &lt;FONT face="courier new,courier"&gt;Check Box()&lt;/FONT&gt; displays that you were originally using - I wasn't clear from your example how the inputs were going to be used if both items (or neither of them) were checked.&amp;nbsp; RadioBox is a nice control if you want one and only one response, but you can use either of the input methods with any set of controls, including &lt;FONT face="courier new,courier"&gt;TextEditBox()&lt;/FONT&gt; for string input or &lt;FONT face="courier new,courier"&gt;NumberEditBox()&lt;/FONT&gt; for numeric input.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 14:09:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244470#M48160</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2020-01-31T14:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244473#M48161</link>
      <description>&lt;P&gt;I tried to change the radio box into check box in your example, but again it is only doing one single graph even if multiple boxes are selected (and actually it is not working for Height &amp;amp; I have no idea why)... I think I still miss something in that script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt=Open("$SAMPLE_DATA/Big Class.jmp");
rc = New Window("Choose the parameters to be plotted",
	cb = Check box ({"weight", "height", "sex"}),
	Button Box("Ok",
		Choose(cb&amp;lt;&amp;lt;Get,
			Graph Builder(Variables(X(:age), Y(:weight))),
			Graph Builder(Variables(X(:age), Y(:height))),
			Graph Builder(Variables(X(:age), Y(:sex)));
		cb&amp;lt;&amp;lt;Close Window;
	)))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 14:17:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244473#M48161</guid>
      <dc:creator>Elofar</dc:creator>
      <dc:date>2020-01-31T14:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244475#M48163</link>
      <description>&lt;P&gt;May not exactly what you need, but if you want to create a Graph for each of the selected variables you might want to consider a Column Dialog to let the operator select the variables he wants to plot in X and Y roles and then plot this for each selected variable:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/15.1/?os=win&amp;amp;source=application#page/jmp/construct-a-column-dialog.shtml#" target="_blank"&gt;https://www.jmp.com/support/help/en/15.1/?os=win&amp;amp;source=application#page/jmp/construct-a-column-dialog.shtml#&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Open("$SAMPLE_DATA/Tablet Production.jmp", Invisible);
cdb = Column Dialog("Add continuous variables you want to plot against Dissolution" ,
	colxx = ColList( "X", Min Col( 1 ), Modeling Type( "Continuous" ) ),
);
show(cdb);
Eval List(cdb[1::N Items(cdb)-1]);

Graph Builder(
	Size( 526, 454 ),
	Show Control Panel( 0 ),
	Variables( X( colxx[1] ), Y( :Dissolution )),
	Elements( Points( X, Y, Legend( 3 ) ), Line Of Fit( X, Y, Legend( 5 ) ) ),
	Column Switcher( colxx[1], colxx )
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 14:24:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244475#M48163</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2020-01-31T14:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244479#M48164</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually I didn't mentionned the full picture: I already have a script which build all graphes one by one, save them into the journal and then close the graph builder. So at the end of this script, I have a journal with all my graphs.&lt;/P&gt;&lt;P&gt;Now I would like to add a first step to this graph which is the variable selection. So I need that the operator selects what he wants, and then for all the selected variable, the second scrip graph builder -&amp;gt; Journal should applies.&lt;/P&gt;&lt;P&gt;Does that make sense?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 14:33:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244479#M48164</guid>
      <dc:creator>Elofar</dc:creator>
      <dc:date>2020-01-31T14:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244490#M48165</link>
      <description>&lt;P&gt;The Choose() method that I used is appropriate for Radio Box, but not as useful for the Check Box input case - it only allows one of the statements to be executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		If(cb&amp;lt;&amp;lt;Get(1),
			Graph Builder(Variables(X(:age), Y(:weight))));
		If(cb&amp;lt;&amp;lt;Get(2),
			Graph Builder(Variables(X(:age), Y(:height))));
		If(cb&amp;lt;&amp;lt;Get(3),
			Graph Builder(Variables(X(:age), Y(:sex))));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that CheckBox&amp;lt;&amp;lt;Get() takes an argument so that you can get the state of each checkbox - this is different from Radio Box, which only allows one item to be selected.&amp;nbsp; For more info on the messages that each display box supports, go to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jmp.com/support/help/en/15.1/#page/jmp/display-functions.shtml#ww2548850" target="_blank"&gt;http://www.jmp.com/support/help/en/15.1/#page/jmp/display-functions.shtml#ww2548850&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 14:58:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244490#M48165</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2020-01-31T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244498#M48167</link>
      <description>ok, makes sense. Even then you could use the column dialog, though you then need to slightly adjust your script to have the correct variable name used. The nice thing is you can use a self defined variable name you want to use in your script further on and remuve the dependency on the table variable names. You still can do an if_else structure, but instead of :age you can use your own name which makes the script more general and usually then also more robust.</description>
      <pubDate>Fri, 31 Jan 2020 15:05:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/244498#M48167</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2020-01-31T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/245302#M48240</link>
      <description>I'm not sure to understand&lt;BR /&gt;I see the point of using the column dialog to ask the operator to select the column but still I don't know how to link that with automatic graph building after?</description>
      <pubDate>Mon, 03 Feb 2020 06:43:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/245302#M48240</guid>
      <dc:creator>Elofar</dc:creator>
      <dc:date>2020-02-03T06:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/245471#M48242</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dialog = Column Dialog(
	col = Col List( "X, Factor", Min Col( 1 ), Max Col( 1 ) )
);

If( dialog["Button"] == -1, Throw( "User cancelled" ) );
Remove From( dialog );
Eval List( dialog );

x = col[1];

dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 454 ),
	Show Control Panel( 0 ),
	Variables( X( x ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 10:26:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/245471#M48242</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-02-03T10:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/245488#M48245</link>
      <description>I just tested this solution and it worked perfectly, thank you !!</description>
      <pubDate>Mon, 03 Feb 2020 12:42:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/245488#M48245</guid>
      <dc:creator>Elofar</dc:creator>
      <dc:date>2020-02-03T12:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/247275#M48536</link>
      <description>Thanks Martin, for this helpful script.</description>
      <pubDate>Wed, 12 Feb 2020 16:03:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/247275#M48536</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2020-02-12T16:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/247300#M48538</link>
      <description>kudos goes to Mark :)&lt;/img&gt;</description>
      <pubDate>Wed, 12 Feb 2020 17:01:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/247300#M48538</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2020-02-12T17:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/247383#M48549</link>
      <description>Sorry for that. Meanwhile I did kudos Mark as well.</description>
      <pubDate>Thu, 13 Feb 2020 07:48:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/247383#M48549</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2020-02-13T07:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Check box to select variable to then plot in graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/807080#M98590</link>
      <description>&lt;P&gt;Simple and effective.&amp;nbsp; Nice!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 00:15:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Check-box-to-select-variable-to-then-plot-in-graph-builder/m-p/807080#M98590</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2024-10-21T00:15:56Z</dc:date>
    </item>
  </channel>
</rss>

