<?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 JSL alternating row legend for multiple variability charts in one window in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-alternating-row-legend-for-multiple-variability-charts-in/m-p/677243#M86351</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm stuck with a scenario. I have a variability graph that has 8 different graphs in one window by using the by clause twice. One case has two options and I want to add a row legend with for one column for one case and another for the other as one has the value colors set differently for one case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the JSL code that I am attempting but is not working to even display the row legends. Any help would be appreciated.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Cars.jmp");
Column(dt, "Size" ) &amp;lt;&amp;lt; Set Property( "Value Colors", {"It" = 0} );

vc = Variability Chart(
	Y( :Wt ),
	X( :Model ),
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	By( :"D/P"n, :Protection )
);

If (Column(dt, "D/P"n)[1] == "Driver",
    vc &amp;lt;&amp;lt; Row Legend("Doors");
);


If (Column(dt, "D/P"n)[1] == "Passenger",
    vc &amp;lt;&amp;lt; Row Legend("Size");
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="neelsrejan_0-1694588517415.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56599i22225CDCB0B82E21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="neelsrejan_0-1694588517415.png" alt="neelsrejan_0-1694588517415.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="neelsrejan_1-1694588545416.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56600i55144BF6BCC9F1AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="neelsrejan_1-1694588545416.png" alt="neelsrejan_1-1694588545416.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The examples above would be the ideal case where if d/p="Driver" then doors is added as the row legend and uses regular colors. But if d/p="passenger" size is added as the row legend and since size has the value colors of It set as black it will automatically add it as it should be as shown from my previous question at:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/JSL-coloring-single-element-of-legend-to-a-custom-color/m-p/676602#M86324" target="_blank"&gt;https://community.jmp.com/t5/Discussions/JSL-coloring-single-element-of-legend-to-a-custom-color/m-p/676602#M86324&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and I am ideally looking for JSL code to do this if possible!&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 07:05:46 GMT</pubDate>
    <dc:creator>neelsrejan</dc:creator>
    <dc:date>2023-09-13T07:05:46Z</dc:date>
    <item>
      <title>JSL alternating row legend for multiple variability charts in one window</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-alternating-row-legend-for-multiple-variability-charts-in/m-p/677243#M86351</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm stuck with a scenario. I have a variability graph that has 8 different graphs in one window by using the by clause twice. One case has two options and I want to add a row legend with for one column for one case and another for the other as one has the value colors set differently for one case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the JSL code that I am attempting but is not working to even display the row legends. Any help would be appreciated.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Cars.jmp");
Column(dt, "Size" ) &amp;lt;&amp;lt; Set Property( "Value Colors", {"It" = 0} );

vc = Variability Chart(
	Y( :Wt ),
	X( :Model ),
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	By( :"D/P"n, :Protection )
);

If (Column(dt, "D/P"n)[1] == "Driver",
    vc &amp;lt;&amp;lt; Row Legend("Doors");
);


If (Column(dt, "D/P"n)[1] == "Passenger",
    vc &amp;lt;&amp;lt; Row Legend("Size");
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="neelsrejan_0-1694588517415.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56599i22225CDCB0B82E21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="neelsrejan_0-1694588517415.png" alt="neelsrejan_0-1694588517415.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="neelsrejan_1-1694588545416.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56600i55144BF6BCC9F1AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="neelsrejan_1-1694588545416.png" alt="neelsrejan_1-1694588545416.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The examples above would be the ideal case where if d/p="Driver" then doors is added as the row legend and uses regular colors. But if d/p="passenger" size is added as the row legend and since size has the value colors of It set as black it will automatically add it as it should be as shown from my previous question at:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/JSL-coloring-single-element-of-legend-to-a-custom-color/m-p/676602#M86324" target="_blank"&gt;https://community.jmp.com/t5/Discussions/JSL-coloring-single-element-of-legend-to-a-custom-color/m-p/676602#M86324&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and I am ideally looking for JSL code to do this if possible!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 07:05:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-alternating-row-legend-for-multiple-variability-charts-in/m-p/677243#M86351</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2023-09-13T07:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSL alternating row legend for multiple variability charts in one window</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-alternating-row-legend-for-multiple-variability-charts-in/m-p/677254#M86353</link>
      <description>&lt;P&gt;Row Legend is set to Frame Box&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1694589121856.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56601i087CF7CA9C0FFF65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1694589121856.png" alt="jthi_0-1694589121856.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you have to set the row legend to different frameboxes. You can either loop over the frameboxes or use some other method of getting references to those (XPath). Below is example using loop&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Cars.jmp");
Column(dt, "Size") &amp;lt;&amp;lt; Set Property("Value Colors",
	{"comp" = -15113984, "hev" = -5682409, "lt" = 0, "med" = -29362, "mini"
	 = -13983232, "mpv" = -13400487, "pu" = -16442434, "van" = -9282864}
);
wait(0);

vcs = dt &amp;lt;&amp;lt; Variability Chart(
	Y(:Wt),
	X(:Model),
	Show Range Bars(0),
	Show Cell Means(0),
	Std Dev Chart(0),
	By(:"D/P"n, :Protection)
);

obs = vcs &amp;lt;&amp;lt; report;
// ob_titles = obs &amp;lt;&amp;lt; get title;

For Each({cur_ob, idx}, obs,
	//cur_ob = obs[1];
	cur_title = cur_ob &amp;lt;&amp;lt; get title;
	If(Contains(cur_title, "Variability Gauge D/P=Driver"),
		cur_ob[FrameBox(1)] &amp;lt;&amp;lt; Row Legend("Doors");
	, Contains(cur_title, "Variability Gauge D/P=Passenger"),
		cur_ob[FrameBox(1)] &amp;lt;&amp;lt; Row Legend("Size", Color Theme(""));
	, // else (do nothing)
		continue();
	);
	// show(cur_title, idx);
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Sep 2023 07:29:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-alternating-row-legend-for-multiple-variability-charts-in/m-p/677254#M86353</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-09-13T07:29:02Z</dc:date>
    </item>
  </channel>
</rss>

