<?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 to add Dynamic horizontal line by shared y axis among variability chart split by two conditions through JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/622737#M82176</link>
    <description>&lt;DIV class="lia-message-subject lia-component-message-view-widget-subject"&gt;
&lt;DIV class="MessageSubject"&gt;
&lt;P&gt;&lt;SPAN class="lia-message-subject"&gt;&lt;LI-MESSAGE title="different spec limits on a variability chart" uid="565177" url="https://community.jmp.com/t5/Discussions/different-spec-limits-on-a-variability-chart/m-p/565177#U565177" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-message-subject"&gt; this post might give some ideas. You will most likely have to use graphic script&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1681540204926.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51994i726FCA01A8A85089/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1681540204926.png" alt="jthi_0-1681540204926.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sat, 15 Apr 2023 06:31:13 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-04-15T06:31:13Z</dc:date>
    <item>
      <title>How to add Dynamic horizontal line by shared y axis among variability chart split by two conditions through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/622722#M82172</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made a variability chart that is split by two conditions, by doing so, jmp creates a chart with a shared y axis. My issue with this shared y axis is when I add a horizontal line, it adds it across each x split rather than being able to have a different horizontal line by group. I was wondering if this is possible by a possible for each loop as the value I want the horizontal line to be a value from the original data table.&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 Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Cars.jmp" );

dt &amp;lt;&amp;lt; Variability Chart(
	Y( :Head IC),
	X( :Make, :Model ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	Points Jittered( 1 ),
	By( :NAME("D/P"), :Protection )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ideal graph.JPG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51993i238A43809F8C811B/image-size/large?v=v2&amp;amp;px=999" role="button" title="ideal graph.JPG" alt="ideal graph.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is ideally how I would like it to look like based on the value in the table.&lt;/P&gt;&lt;P&gt;My current attempt at this is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for each( {bygroup, i}, value,
	report(dt[i])[AxisBox(1)] &amp;lt;&amp;lt; add ref line(value[i], "Dotted","Black", Char(value[i]))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For the sake of being able to with this dataset, if you are able to use the column ":Wt" to show this I would be truly grateful. Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:31:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/622722#M82172</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2023-06-11T11:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add Dynamic horizontal line by shared y axis among variability chart split by two conditions through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/622737#M82176</link>
      <description>&lt;DIV class="lia-message-subject lia-component-message-view-widget-subject"&gt;
&lt;DIV class="MessageSubject"&gt;
&lt;P&gt;&lt;SPAN class="lia-message-subject"&gt;&lt;LI-MESSAGE title="different spec limits on a variability chart" uid="565177" url="https://community.jmp.com/t5/Discussions/different-spec-limits-on-a-variability-chart/m-p/565177#U565177" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-message-subject"&gt; this post might give some ideas. You will most likely have to use graphic script&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1681540204926.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/51994i726FCA01A8A85089/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1681540204926.png" alt="jthi_0-1681540204926.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 15 Apr 2023 06:31:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/622737#M82176</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-04-15T06:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add Dynamic horizontal line by shared y axis among variability chart split by two conditions through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/622788#M82182</link>
      <description>&lt;P&gt;The thing to keep in mind about the VariabilityPlot is that each least-significant-group has a width of exactly 1 on the hidden x-axis, starting at zero.&amp;nbsp; This makes it pretty simple to add the relevant lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only slight complication is figuring out how many sub-groups each of the larger groups contains, but the Summary function of the data table can aid there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example script that does what you ask:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test_me.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/52002i25E2BCBCE59E7B16/image-size/large?v=v2&amp;amp;px=999" role="button" title="test_me.png" alt="test_me.png" /&gt;&lt;/span&gt;&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 Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Cars.jmp" );

rpt = dt &amp;lt;&amp;lt; Variability Chart(
	Y( :Head IC),
	X( :Make, :Model ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	Points Jittered( 1 ),
	Where( :NAME("D/P") == "Driver" &amp;amp; :Protection == "manual belts" ),
);

//find groupings:
rows = dt &amp;lt;&amp;lt; Get Rows Where( :NAME("D/P") == "Driver" &amp;amp; :Protection == "manual belts" );
subt = dt &amp;lt;&amp;lt; Subset( Rows( rows ), Columns( :Make, :Model, :Wt ), Not Linked, Private );
sumt = subt &amp;lt;&amp;lt; Summary( Group( :Make, Model ), Mean( :Wt ), Statistics Column Name Format( "Column" ), Link to Original Data Table( 0 ), Private );
Close( subt, No Save );
subt = sumt &amp;lt;&amp;lt; Summary( Group( :Make ), Mean( :Wt ), Statistics Column Name Format( "Column" ), Link to Original Data Table( 0 ), Private );
Close( sumt, No Save );

category number = [=&amp;gt;];
category average = [=&amp;gt;];
For Each Row( subt,
	category number[:Make] = :N Rows; // each least-significant category in a VariabilityPlot is exactly X=1 width on the hidden x-axis, starting at zero
	category average[:Make] = :Wt
);
Close( subt, No Save );

tree = rpt &amp;lt;&amp;lt; Report;
Eval( Eval Expr(
tree[FrameBox( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
	Local( {values = Expr( category average ), numbers = Expr( category number ), i, items, sum = 0},
		items = numbers &amp;lt;&amp;lt; Get Keys;
		Pen Size( 2 );
		Pen Color( "Blue" );
		Summation( i = 1, N Items( items ),
			Line( Eval List( {sum, values[items[i]]} ), Eval List( {sum += numbers[items[i]], values[items[i]]} ) );
			0
		)
	)
)
) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Apr 2023 14:26:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/622788#M82182</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2023-04-18T14:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add Dynamic horizontal line by shared y axis among variability chart split by two conditions through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/623152#M82207</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, thank you so much for the information as well as the code, I am trying to go by line by line and learn just how you scripted this. When I ran the script, I am getting an error for the "cagegories &amp;lt;&amp;lt; Get Keys" line it seems through the console log. Would you know how to fix this or if it's supposed to be another variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="categories.JPG" style="width: 901px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/52030iB7B00BB0AA85B2B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="categories.JPG" alt="categories.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="log.JPG" style="width: 921px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/52031i97A6079328089A4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="log.JPG" alt="log.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you, I appreciate the help!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 20:18:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/623152#M82207</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2023-04-17T20:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to add Dynamic horizontal line by shared y axis among variability chart split by two conditions through JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/623452#M82230</link>
      <description>&lt;P&gt;Sorry about that -- I'd only partially changed the variable names.&amp;nbsp; The name &lt;CODE class=" language-jsl"&gt;categories&lt;/CODE&gt; should have been &lt;CODE class=" language-jsl"&gt;numbers&lt;/CODE&gt;.&amp;nbsp; I've edited by reply above.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 14:27:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-add-Dynamic-horizontal-line-by-shared-y-axis-among/m-p/623452#M82230</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2023-04-18T14:27:40Z</dc:date>
    </item>
  </channel>
</rss>

