<?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: Modifying Graph builder legend properties / Documentation for legend Model() in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522649#M74734</link>
    <description>&lt;P&gt;It looks like &lt;EM&gt;Legend Server&lt;/EM&gt; is a JMP16 addition.&lt;/P&gt;&lt;P&gt;Although I have JMP16 installed most of my org are still using JMP14 or JMP15.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a JMP GUI to share with the team, so I will need to stick with JMP15 for now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;- thank you for the inputs - I will definitely use this in the future (just not right now).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 10:32:40 GMT</pubDate>
    <dc:creator>rbfinner</dc:creator>
    <dc:date>2022-07-18T10:32:40Z</dc:date>
    <item>
      <title>Modifying Graph builder legend properties / Documentation for legend Model()</title>
      <link>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522242#M74712</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a method to consistently target and modify legend items in graph builder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I've added variables to generate the basic graph, I use the dispatch statements to modify the line-style/color/size.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue that I'm running into is that the&amp;nbsp;legend text (or the item Ids) change depending on what rows I have included/excluded in the data table, and therefore the dispatch statement will work for some selections but not for others.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;LHS, I have multiple rows per x-category (YearMonth).&amp;nbsp;&lt;/P&gt;&lt;P&gt;The legend text has the format - "Mean(ColumnName)"&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;RHS, with rows excluded I only have a &lt;SPAN&gt;single&lt;/SPAN&gt; row per x-category.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The legend text has the format - "ColumnName"&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rbfinner_1-1657998504036.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44046i2E9A563603C355B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rbfinner_1-1657998504036.png" alt="rbfinner_1-1657998504036.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rbfinner_0-1657998470939.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44045i9E99D3B0BDF70998/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rbfinner_0-1657998470939.png" alt="rbfinner_0-1657998470939.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To modify the legend items I'm using the legend Model (...)&amp;nbsp;statement as below, where&amp;nbsp;Item ID( "Mean(Yield_A)", 1 )&amp;nbsp;identifies the item to modify.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb &amp;lt;&amp;lt; send to report (
Dispatch(
{},
"400",
ScaleBox,
{Legend Model( 15,
				Level Name( 0, "Yield_A", Item ID( "Mean(Yield_A)", 1 ) ),
				Properties( 0, {Line Color( "red"  ), Line Width( 6 )}, Item ID( "Mean(Yield_A)", 1 ) ),
			)
}
));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I use a data table filter to include/exclude rows to narrow down the graph to a single segment or product.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When filtered to a single product, there is a single row per YearMonth, and the legend text changes as highlighted in the above RHS graph.&lt;/P&gt;&lt;P&gt;The original Item ID( "Mean(Yield_A)", 1 )&amp;nbsp; used in the dispatch statement will not find a matching item (the columnname is no longer wrapped in mean())&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One workaround is to duplicate the legend model () statement/s, to target legend text with format of&amp;nbsp; "ColumnName", e.g. Item ID( "Yield_A", 1 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works but it is cumbersome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Qs:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Is there an alternative / better method to target the legend items that will work for both cases noted above?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Is there any standalone documentation for the legend model() statement or its components (I couldn't find it)?&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One last thought... I'm assuming that when there is only a single row/value for each x-category, dropping of the Mean() wrapper in the legend text is intentional, but perhaps it would make sense still have the legend item display as "Mean(columnName)", even when there is only a single value? After all, the summary statistic for the line element is still set to "Mean".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:25:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522242#M74712</guid>
      <dc:creator>rbfinner</dc:creator>
      <dc:date>2023-06-11T11:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying Graph builder legend properties / Documentation for legend Model()</title>
      <link>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522259#M74713</link>
      <description>&lt;P&gt;Check Scripting Index for Legend Server, it allows you to change legend labels at least (documentation is fairly bad for Legend Server though)&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 = Graph Builder(
	Variables(X(:height), Y(:weight), Overlay(:sex), Color(:age)),
	Elements(Points(X, Y, Legend(1)), Smoother(X, Y, Legend(2)))
);
server = gb &amp;lt;&amp;lt; Get Legend Server;
items = server &amp;lt;&amp;lt; Get Legend Items;
For Each({item, index}, items[1], item &amp;lt;&amp;lt; Set Label("Item " || Char(index)));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Jul 2022 19:24:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522259#M74713</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-07-16T19:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying Graph builder legend properties / Documentation for legend Model()</title>
      <link>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522649#M74734</link>
      <description>&lt;P&gt;It looks like &lt;EM&gt;Legend Server&lt;/EM&gt; is a JMP16 addition.&lt;/P&gt;&lt;P&gt;Although I have JMP16 installed most of my org are still using JMP14 or JMP15.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a JMP GUI to share with the team, so I will need to stick with JMP15 for now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;- thank you for the inputs - I will definitely use this in the future (just not right now).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 10:32:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522649#M74734</guid>
      <dc:creator>rbfinner</dc:creator>
      <dc:date>2022-07-18T10:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying Graph builder legend properties / Documentation for legend Model()</title>
      <link>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522650#M74735</link>
      <description>&lt;P&gt;I accepted the above as a solution, but it works for JMP16 only. So still open to other suggestions/options that might work with JMP15. Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 10:43:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modifying-Graph-builder-legend-properties-Documentation-for/m-p/522650#M74735</guid>
      <dc:creator>rbfinner</dc:creator>
      <dc:date>2022-07-18T10:43:03Z</dc:date>
    </item>
  </channel>
</rss>

