<?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 Can  I set graph builder title based on variable from a H list box? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713667#M89712</link>
    <description>&lt;P&gt;I have a H list box window that users can input parameters, after that I will do some calculations and provide a graph builder to user&lt;/P&gt;&lt;P&gt;My question is can I set graph builder title also based on the parameters from the H list box?&amp;nbsp; below is the sample code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = current data table();
nw = New Window( "simulator",
	H List Box( Text Box( "   Input sample rate " ), sample rate = Number Edit Box() ), 
	H List Box( Text Box( "   Input threshold " ), threshold = Number Edit Box() ),
	Button Box( "OK",
    thesamplerate = sample rate &amp;lt;&amp;lt; get;
	thethreshold = threshold &amp;lt;&amp;lt; get;
    numthreshold = num(thethreshold);
    numtime = num(thetime);

    //Here are more code I already finished based on above variable

Graph Builder(
	Variables( X( :File Name ), Y( :greater ) ),
	Elements( Bar( X, Y, Legend( 4 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"graph title",
			TextEditBox,
			{Set Text( "Sample rate =    Threshold = " )} //I want to have sample rate &amp;amp; threshold shown on title
		)
	)
)
))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jan 2024 04:25:47 GMT</pubDate>
    <dc:creator>BayesRabbit7133</dc:creator>
    <dc:date>2024-01-05T04:25:47Z</dc:date>
    <item>
      <title>Can  I set graph builder title based on variable from a H list box?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713667#M89712</link>
      <description>&lt;P&gt;I have a H list box window that users can input parameters, after that I will do some calculations and provide a graph builder to user&lt;/P&gt;&lt;P&gt;My question is can I set graph builder title also based on the parameters from the H list box?&amp;nbsp; below is the sample code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = current data table();
nw = New Window( "simulator",
	H List Box( Text Box( "   Input sample rate " ), sample rate = Number Edit Box() ), 
	H List Box( Text Box( "   Input threshold " ), threshold = Number Edit Box() ),
	Button Box( "OK",
    thesamplerate = sample rate &amp;lt;&amp;lt; get;
	thethreshold = threshold &amp;lt;&amp;lt; get;
    numthreshold = num(thethreshold);
    numtime = num(thetime);

    //Here are more code I already finished based on above variable

Graph Builder(
	Variables( X( :File Name ), Y( :greater ) ),
	Elements( Bar( X, Y, Legend( 4 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"graph title",
			TextEditBox,
			{Set Text( "Sample rate =    Threshold = " )} //I want to have sample rate &amp;amp; threshold shown on title
		)
	)
)
))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 04:25:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713667#M89712</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2024-01-05T04:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can  I set graph builder title based on variable from a H list box?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713693#M89714</link>
      <description>&lt;P&gt;Here is the method that I normally use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
nw = New Window( "simulator",
	H List Box( Text Box( "   Input sample rate " ), sample rate = Number Edit Box() ),
	H List Box( Text Box( "   Input threshold " ), threshold = Number Edit Box() ),
	Button Box( "OK",
		thesamplerate = sample rate &amp;lt;&amp;lt; get;
		thethreshold = threshold &amp;lt;&amp;lt; get;
		numthreshold = Num( thethreshold );
		numtime = Num( thetime );

    //Here are more code I already finished based on above variable

		gb = Graph Builder( Variables( X( :File Name ), Y( :greater ) ), Elements( Bar( X, Y, Legend( 4 ) ) ) );
		// Set the title
		Report( gb )[Outline Box( 1 ), Text Edit Box( 1 )] &amp;lt;&amp;lt; set text( "Sample Rate=" || Char( thesamplerate ) );
		
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jan 2024 05:12:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713693#M89714</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-01-05T05:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can  I set graph builder title based on variable from a H list box?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713694#M89715</link>
      <description>&lt;P&gt;You could build the title using Eval Insert or string concatenation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one option&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("simulator",
	H List Box(Text Box("   Input sample rate "), sample rate = Number Edit Box()),
	H List Box(Text Box("   Input threshold "), threshold = Number Edit Box()),
	Button Box("OK",
		thesamplerate = sample rate &amp;lt;&amp;lt; get;
		thethreshold = threshold &amp;lt;&amp;lt; get;
		//numthreshold = Num(thethreshold);
		//numtime = Num(thetime);
		gb = dt &amp;lt;&amp;lt; Graph Builder(
			Variables(X(:age), Y(:weight)),
			Elements(Bar(X, Y, Legend(4)))
		);
		Report(gb)[TextEditBox(1)] &amp;lt;&amp;lt; Set Text(Eval Insert("Sample rate = ^thesamplerate^   Threshold = ^thethreshold^"));
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should be able to also insert it directly to the title in SendToReport. Here I also build title variable separately but it isn't necessary but can make debugging and such easier&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("simulator",
	H List Box(Text Box("   Input sample rate "), sample rate = Number Edit Box()),
	H List Box(Text Box("   Input threshold "), threshold = Number Edit Box()),
	Button Box("OK",
		thesamplerate = sample rate &amp;lt;&amp;lt; get;
		thethreshold = threshold &amp;lt;&amp;lt; get;
		//numthreshold = Num(thethreshold);
		//numtime = Num(thetime);
		graph_title = Eval Insert("Sample rate = ^thesamplerate^   Threshold = ^thethreshold^");
		gb = dt &amp;lt;&amp;lt; Graph Builder(
			Variables(X(:age), Y(:weight)),
			Elements(Bar(X, Y, Legend(4))),
			SendToReport(
				Dispatch(
					{},
					"graph title",
					TextEditBox,
					{Set Text(graph_title)} //I want to have sample rate &amp;amp; threshold shown on title
				)
			)
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jan 2024 05:13:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713694#M89715</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-01-05T05:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can  I set graph builder title based on variable from a H list box?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713695#M89716</link>
      <description>&lt;P&gt;Thank you both for your prompt reply&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 05:20:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-I-set-graph-builder-title-based-on-variable-from-a-H-list/m-p/713695#M89716</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2024-01-05T05:20:09Z</dc:date>
    </item>
  </channel>
</rss>

