<?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: How do I use jsl add X variable to graphbuilder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/733527#M91489</link>
    <description>&lt;P&gt;&amp;lt;&amp;lt; Add Variable should work but some cases can be more complicated&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(528, 448),
	Show Control Panel(0),
	Variables(X(:weight), X(:height, Position(1))),
	Elements(Parallel(X(1), X(2), Legend(9)))
);

wait(1); // for demo purposes

gb &amp;lt;&amp;lt; Add Variable({:age, Role("X"), Position(1)});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Mar 2024 19:44:56 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-03-12T19:44:56Z</dc:date>
    <item>
      <title>How do I use jsl add X variable to graphbuilder</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/730386#M91321</link>
      <description>&lt;P&gt;Dear all:&lt;/P&gt;&lt;P&gt;I want to create a parallel graph&lt;BR /&gt;The X-axis is part of the column in the table&lt;BR /&gt;How to create using jsl&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also try add variable() but cannot work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 01:58:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/730386#M91321</guid>
      <dc:creator>Wei1</dc:creator>
      <dc:date>2024-03-07T01:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use jsl add X variable to graphbuilder</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/733527#M91489</link>
      <description>&lt;P&gt;&amp;lt;&amp;lt; Add Variable should work but some cases can be more complicated&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(528, 448),
	Show Control Panel(0),
	Variables(X(:weight), X(:height, Position(1))),
	Elements(Parallel(X(1), X(2), Legend(9)))
);

wait(1); // for demo purposes

gb &amp;lt;&amp;lt; Add Variable({:age, Role("X"), Position(1)});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2024 19:44:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/733527#M91489</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-12T19:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use jsl add X variable to graphbuilder</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/733934#M91502</link>
      <description>&lt;P&gt;Thanks，&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have other question,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I can use Add Variable to add X variables to graph builder,&lt;/P&gt;&lt;P&gt;but cannot change to parallel graph for add X variable (auto) by use Add Element&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer to the attachment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt=Current Data Table();

colnames=dt&amp;lt;&amp;lt; get column names( "character" );
remove from(colnames,nitems(colnames));
remove from(colnames,1);

variables_expr = Expr(Variables(X(:X__1)));

gb = dt &amp;lt;&amp;lt; Graph Builder(
Size( 1854, 917 ),
 Show control Panel(0),
 Variables(X(:X__1)),
 Color( :color ),				
		Size( :Amt )
);

gb &amp;lt;&amp;lt; inval;

For Each({x_col, idx}, colnames,
 Eval(EvalExpr(
  gb &amp;lt;&amp;lt; Add Variable({Expr(Name Expr(As Column(dt, x_col))), Role("X"),position(1)})
 ));


);

&lt;FONT color="#0000FF"&gt;// question&lt;/FONT&gt;
&lt;FONT color="#0000FF"&gt;gb &amp;lt;&amp;lt; Add Element( 1, 1, {Type( "Parallel" ),Legend( 4 ),Combine Sets( 1 )} );&lt;/FONT&gt;


gb &amp;lt;&amp;lt; Update window;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 02:04:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/733934#M91502</guid>
      <dc:creator>Wei1</dc:creator>
      <dc:date>2024-03-13T02:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use jsl add X variable to graphbuilder</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/734074#M91513</link>
      <description>&lt;P&gt;If you build the parallel plot by hand and check the script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size(490, 448),
	Show Control Panel(0),
	Variables(
		X(:X__1),
		X(:X__2, Position(1)),
		X(:X__3, Position(1)),
		X(:X__4, Position(1)),
		X(:X__5, Position(1))
	),
	Elements(Parallel(X(1), X(2), X(3), X(4), X(5), Legend(18)))
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then compare it to your script (build it and then get script from red triangle menu)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size(1854, 917),
	Show Control Panel(0),
	Variables(
		X(:X__1),
		X(:X__2, Position(1)),
		X(:X__3, Position(1)),
		X(:X__4, Position(1)),
		X(:X__5, Position(1))
	),
	Elements(
		Points(X(1), X(2), X(3), X(4), X(5), Legend(5)),
		Parallel(Legend(4), Combine Sets(1))
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are few big differences: you still have points left and you only haven't defined X() in your script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is what you wish to do, I would suggest building the graph builder expression and not using &amp;lt;&amp;lt; Add Variable and &amp;lt;&amp;lt; Add Element as it can be easier&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

colnames = dt &amp;lt;&amp;lt; get column names("character");
Remove From(colnames, N Items(colnames));
Remove From(colnames, 1);

variables_expr = Expr(Variables(X(:X__1)));
parallel_expr = Expr(Parallel(X(1)));

For Each({colname, idx}, colnames,
	xpart = EvalExpr(X(Expr(NameExpr(AsColumn(dt, colname))), Position(1)));
	Insert Into(variables_expr, Name Expr(xpart));
	
	Eval(EvalExpr(
		Insert Into(parallel_expr, Name Expr(X(Expr(idx + 1))));
	));
);

Insert Into(parallel_expr, Name Expr(Legend(18)));
elements_expr = Expr(Elements());
InsertInto(elements_expr, NameExpr(parallel_expr));


gb = Eval(Substitute(
		Expr(dt &amp;lt;&amp;lt; Graph Builder(
			Size(1854, 917),
			Show control Panel(0),
			_variables_,
			_elements_,
			Color(:color),
			Size(:Amt)
	)),
	Expr(_variables_), Name Expr(variables_expr),
	Expr(_elements_), Name Expr(elements_expr)
));

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 06:19:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-jsl-add-X-variable-to-graphbuilder/m-p/734074#M91513</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-13T06:19:46Z</dc:date>
    </item>
  </channel>
</rss>

