<?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: If statement inside graph builder for SendToReport functionality in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242364#M47863</link>
    <description>&lt;P&gt;An easier way to do this is by passing messages to the display objects created by Graph Builder.&amp;nbsp; The messages can be pass after the graph is produced.&amp;nbsp; All of these messages are documented in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;and then look for the AxisBox object&lt;/P&gt;
&lt;P&gt;Here is a modification to your code that should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;graph_func = Function( {stackdt, title},
	{Default Local},
	gb = Graph Builder(
		Size( 1342, 905 ),
		Variables( X( :names ), Y( As Column( title ) ), Group X( :Type ), Overlay( :GROUPs ) ),
		Elements( Box Plot( X, Y, Legend( 11 ) ) ),
		Local Data Filter( Add Filter( columns( :Type ), Display( :Type, Size( 160, 30 ), List Display ) ) )
		
	);
If( Contains( title, "error" ),	
	report(gb)[AxisBox(2)] &amp;lt;&amp;lt; min(0.00001) &amp;lt;&amp;lt; Max( 0.03 ) &amp;lt;&amp;lt; Inc( 1 ) &amp;lt;&amp;lt;Minor Ticks( 1 ) &amp;lt;&amp;lt; Format( "Scientific", 10 );
);	
	
	Return( gb );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Jan 2020 18:06:14 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-01-22T18:06:14Z</dc:date>
    <item>
      <title>If statement inside graph builder for SendToReport functionality</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242345#M47860</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to be able to change the graph's Y-axis only when the Y-axis is a certain column(say errors). But looks like the graphbuilder doesn't recognize the if inside it. However, this works fine when i don't use the if statement. But i want to be able to use this same graph function for all kinds of graphs.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;graph_func = function({stackdt,title},{Default Local},
				gb = Graph Builder(
					Size( 1342, 905 ),
					Variables(
						X( :names ),
						Y( as column(title) ),
						Group X( :Type ),
						Overlay( :GROUPs )
					),
					Elements( Box Plot( X, Y, Legend( 11 ) ) ),
					Local Data Filter(
					Add Filter(
						columns( :Type), 
						Display( :Type, Size( 160, 30 ), List Display )
					)	),
				if(contains(title,"error"),
					SendToReport(
						Dispatch(
							{},
							title,
							ScaleBox,
							{Scale( "Log" ), Format( "Scientific", 10 ), Min( 0.00001 ), Max( 0.03 ),
							Inc( 1 ), Minor Ticks( 1 )}
						)
					) , )  );
				return(gb);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jan 2020 17:44:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242345#M47860</guid>
      <dc:creator>Juber</dc:creator>
      <dc:date>2020-01-22T17:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: If statement inside graph builder for SendToReport functionality</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242360#M47862</link>
      <description>&lt;P&gt;As I have mentioned in other discussions, Send To Report() is intended for JMP to be able to save a script for you and capture any customization that you might have done. There are better ways to customize your window when you are writing a script. For example,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb = dt &amp;lt;&amp;lt; Graph Builder( /* usual plot arguments */ );

If( error plot,
	Report( gb )[AxisBox(1)] &amp;lt;&amp;lt; Min( 0 ) &amp;lt;&amp;lt; Max( 10 ) &amp;lt;&amp;lt; Inc( 1 );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would launch Graph Builder with the default customization (not for plotting errors). I would have a way of flagging the exception (plotting errors) and use the If() function to determine if messages should be sent to the object. In the example above, the error plot argument could be a flag (Boolean variable) or it could be an expression that returns true when you a plotting the errors. The messages are sent to the vertical axis in this case to change the scale. You can use this illustration&amp;nbsp; of build any customization that you like.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 17:59:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242360#M47862</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-01-22T17:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: If statement inside graph builder for SendToReport functionality</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242364#M47863</link>
      <description>&lt;P&gt;An easier way to do this is by passing messages to the display objects created by Graph Builder.&amp;nbsp; The messages can be pass after the graph is produced.&amp;nbsp; All of these messages are documented in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;and then look for the AxisBox object&lt;/P&gt;
&lt;P&gt;Here is a modification to your code that should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;graph_func = Function( {stackdt, title},
	{Default Local},
	gb = Graph Builder(
		Size( 1342, 905 ),
		Variables( X( :names ), Y( As Column( title ) ), Group X( :Type ), Overlay( :GROUPs ) ),
		Elements( Box Plot( X, Y, Legend( 11 ) ) ),
		Local Data Filter( Add Filter( columns( :Type ), Display( :Type, Size( 160, 30 ), List Display ) ) )
		
	);
If( Contains( title, "error" ),	
	report(gb)[AxisBox(2)] &amp;lt;&amp;lt; min(0.00001) &amp;lt;&amp;lt; Max( 0.03 ) &amp;lt;&amp;lt; Inc( 1 ) &amp;lt;&amp;lt;Minor Ticks( 1 ) &amp;lt;&amp;lt; Format( "Scientific", 10 );
);	
	
	Return( gb );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jan 2020 18:06:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242364#M47863</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-22T18:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: If statement inside graph builder for SendToReport functionality</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242366#M47864</link>
      <description>Thanks for replying. I tried the 2nd solution as that looked straightforward with what I'm doing. It works but the Y-axis has only 2 points now i.e. min and max. How do i make it display the scale on Yaxis?</description>
      <pubDate>Wed, 22 Jan 2020 19:50:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242366#M47864</guid>
      <dc:creator>Juber</dc:creator>
      <dc:date>2020-01-22T19:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: If statement inside graph builder for SendToReport functionality</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242378#M47866</link>
      <description>&lt;P&gt;Could you please supply your JSL and an image of the display output.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 21:23:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/242378#M47866</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-22T21:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: If statement inside graph builder for SendToReport functionality</title>
      <link>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/244560#M48187</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juber_0-1580494669919.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21466i2AFA29E876FFE895/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Juber_0-1580494669919.png" alt="Juber_0-1580494669919.png" /&gt;&lt;/span&gt;&amp;nbsp;Can't really supply the JSL or the entire graph because of company's privacy policy, but here's what the X-axis looks like. There are 3 groups on the Group Y axis and errors on Y-axis. I want to be able to see all the intermediate points on y-axis and not just min and max like how it is.&lt;/P&gt;&lt;P&gt;Also, when i split a different group according to page, this only applies to the 1st graph and not the subsequent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 18:20:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/If-statement-inside-graph-builder-for-SendToReport-functionality/m-p/244560#M48187</guid>
      <dc:creator>Juber</dc:creator>
      <dc:date>2020-01-31T18:20:06Z</dc:date>
    </item>
  </channel>
</rss>

