<?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: Graph Builder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230026#M45650</link>
    <description>&lt;P&gt;Thank you for the reply! Do you have any idea how i should do it for the script to automatically run the script in different data sets with different column names without having to use the graph builder interactively?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Interactively, go to Graph Builder, and develop the graph to look the way you want it to look, and then just simply go to the red triangle, and select "Save Script". JMP creates the JSL for you.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Oct 2019 14:00:36 GMT</pubDate>
    <dc:creator>skyzvoir0001</dc:creator>
    <dc:date>2019-10-22T14:00:36Z</dc:date>
    <item>
      <title>Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230001#M45640</link>
      <description>&lt;P&gt;Hi, im new to the jmp scripting language. The code below works(it shows bar graphs of the column 3 to n) but there is one thing i'd want to do. How do i script such that my output should be a stacked bar chart of all columns?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for(i=3,i&amp;lt;=NItems(colList2),i++,&lt;/P&gt;&lt;P&gt;gb= dt4 &amp;lt;&amp;lt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Graph Builder(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size(534,454),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Show Control Panel(0),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Variables(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X(:Label),Y(eval(Column(dt4,colList2[i]))),&lt;/P&gt;&lt;P&gt;),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Elements(Bar(X,Y))&lt;/P&gt;&lt;P&gt;));&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 13:19:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230001#M45640</guid>
      <dc:creator>skyzvoir0001</dc:creator>
      <dc:date>2019-10-22T13:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230018#M45647</link>
      <description>Interactively, go to Graph Builder, and develop the graph to look the way you want it to look, and then just simply go to the red triangle, and select "Save Script".  JMP creates the JSL for you.</description>
      <pubDate>Tue, 22 Oct 2019 13:42:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230018#M45647</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-10-22T13:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230026#M45650</link>
      <description>&lt;P&gt;Thank you for the reply! Do you have any idea how i should do it for the script to automatically run the script in different data sets with different column names without having to use the graph builder interactively?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Interactively, go to Graph Builder, and develop the graph to look the way you want it to look, and then just simply go to the red triangle, and select "Save Script". JMP creates the JSL for you.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 14:00:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230026#M45650</guid>
      <dc:creator>skyzvoir0001</dc:creator>
      <dc:date>2019-10-22T14:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230033#M45653</link>
      <description>&lt;P&gt;There is not a single statement that can be expanded on to cover a different number of incoming Y columns.&amp;nbsp; Therefore, you need to take the basic form, and dynamically create it depending upon the number of columns&lt;/P&gt;
&lt;P&gt;Here is the basic form&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables(
		X( :SITE ),
		Y( :NPN1 ),
		Y( :PNP1, Position( 1 ) ),
		Y( :PNP2, Position( 1 ) ),
		Y( :NPN2, Position( 1 ) ),
		Y( :PNP3, Position( 1 ) )
	),
	Elements(
		Bar(
			X,
			Y( 1 ),
			Y( 2 ),
			Y( 3 ),
			Y( 4 ),
			Y( 5 ),
			Legend( 4 ),
			Bar Style( "Stacked" )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is the Example script that I created that dynamically builds a stacked bar chart&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA/Blood Pressure.jmp");

// Get all of the continuous data columns
colList = dt &amp;lt;&amp;lt; get column names(continuous,string);

// Create the JSL to create the script
theExpr = "Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Dose ),";
		
// Add the first Y entry
theExpr = theExpr || "Y( :" || colList[1] || " )";

// Add the remaining Y entries
For( i=2, i&amp;lt;= n items(colList), i++,
	theExpr = theExpr || ", Y( :" || colList[i] || ", Position( 1 ) )"; 
);

// Finish up the Variables list, and start the Elements
theExpr = theExpr || "), Elements( Bar(X, Y( 1 )";

// Add the remaining Y elements
For( i=2, i&amp;lt;= n items(colList), i++,
	theExpr = theExpr || ", Y( " || char(i) || " )"; 
);

// Finish up the required specifications
theExpr = theExpr || ",
			Legend( 4 ),
			Bar Style( \!"Stacked\!" )
		)
	)
);";

// Run the created JSL
eval(parse(theExpr));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That produces&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bp.PNG" style="width: 680px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19821iE76AD81E421D8203/image-size/large?v=v2&amp;amp;px=999" role="button" title="bp.PNG" alt="bp.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 14:56:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder/m-p/230033#M45653</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-10-22T14:56:25Z</dc:date>
    </item>
  </channel>
</rss>

