<?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 issue with get legend items in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825469#M100573</link>
    <description>&lt;P&gt;In JMP18 (18.1.1) this example from scripting index doesn't work:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1735559112278.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71581iD2F1FDCA6DC80FC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_2-1735559112278.png" alt="hogi_2-1735559112278.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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( "$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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It produces the error message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1735559069148.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71580iAED8D4D68DA41CB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1735559069148.png" alt="hogi_1-1735559069148.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;so,&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Legend Server &amp;lt;&amp;lt;&amp;nbsp; get legend items()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;doesn't return scriptable objects?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Dec 2024 21:42:13 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2024-12-30T21:42:13Z</dc:date>
    <item>
      <title>issue with get legend items</title>
      <link>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825469#M100573</link>
      <description>&lt;P&gt;In JMP18 (18.1.1) this example from scripting index doesn't work:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1735559112278.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71581iD2F1FDCA6DC80FC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_2-1735559112278.png" alt="hogi_2-1735559112278.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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( "$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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It produces the error message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1735559069148.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71580iAED8D4D68DA41CB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1735559069148.png" alt="hogi_1-1735559069148.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;so,&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Legend Server &amp;lt;&amp;lt;&amp;nbsp; get legend items()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;doesn't return scriptable objects?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 21:42:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825469#M100573</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-30T21:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: get legend items: no scriptable objects</title>
      <link>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825489#M100575</link>
      <description>&lt;P&gt;workaround:&lt;BR /&gt;use &lt;FONT face="courier new,courier"&gt;get legend item&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Don't forget to pre-evaluate &lt;FONT face="courier new,courier"&gt;i&lt;/FONT&gt; for &lt;FONT face="courier new,courier"&gt;get legend item&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;- for &lt;FONT face="courier new,courier"&gt;set label&lt;/FONT&gt; no pre-evaluation is needed.&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( "$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;
Nitems = Nitems(( server &amp;lt;&amp;lt; Get Legend Items)[1]);
for(i=1, i&amp;lt;= Nitems, i++, 
Eval(Eval Expr(item = server  &amp;lt;&amp;lt; Get Legend Item(1, Expr(i))));
	item &amp;lt;&amp;lt; Set Label( "Item " || Char( i ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Dec 2024 12:19:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825489#M100575</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-30T12:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: get legend items: no scriptable objects</title>
      <link>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825491#M100576</link>
      <description>&lt;P&gt;Next trap: doesn' work for Bar Graphs ?&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( :age ), Y( :weight ), Overlay( :sex ) ),
	Elements( Bar( X, Y ) )
);
server = gb &amp;lt;&amp;lt; Get Legend Server;

items = server &amp;lt;&amp;lt; Get Legend Items;
show(items);

server &amp;lt;&amp;lt; get legend item(1,1)&amp;nbsp;//&amp;nbsp;error&amp;nbsp;message&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1735561837580.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71582i1D2AAE164BF83223/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1735561837580.png" alt="hogi_0-1735561837580.png" /&gt;&lt;/span&gt;&lt;BR /&gt;edit: I could not reproduce the issue on another computer / after a restart of JMP (?).&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 22:20:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825491#M100576</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-30T22:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: get legend items: no scriptable objects</title>
      <link>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825505#M100578</link>
      <description>&lt;P&gt;It actually does return scriptable objects.&amp;nbsp; Looks like this is a bug with For Each().&amp;nbsp; If you change the code to something that should be equivalent, it works.&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( "$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],
	items[1][index] /*isn't this exactly what item is?*/ &amp;lt;&amp;lt; Set Label( "Item " || Char( index ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Dec 2024 15:40:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825505#M100578</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2024-12-30T15:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: get legend items: no scriptable objects</title>
      <link>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825508#M100580</link>
      <description>&lt;P&gt;Ah, sorry, you are right, the individual items are indeed scriptable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interesting: a batch message like &lt;CODE class=" language-jsl"&gt;items &amp;lt;&amp;lt; get label &lt;/CODE&gt;produces the same issue.&lt;BR /&gt;maybe batch messages use &lt;FONT face="courier new,courier"&gt;for each&lt;/FONT&gt; in the background ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Digging deeper, I found an old ticket:&amp;nbsp;TS-00128192&lt;/P&gt;&lt;P&gt;Fortunately, in the mean time the issue got enough prio -- in JMP19 (EA5) it's fixed:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1735595525931.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71585iB58B6DDFAA07D3AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1735595525931.png" alt="hogi_0-1735595525931.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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( "$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;&lt;BR /&gt;&lt;BR /&gt;items &amp;lt;&amp;lt; get label // same issue as with for each

show(items[1][1])
items[1][1] &amp;lt;&amp;lt; get label(); // OK, on the lowest level, there &lt;U&gt;is&lt;/U&gt; a scriptable object 

Show(tmp = items[1][1::2]); // then this is a list of ...
tmp[1] &amp;lt;&amp;lt; get Label(); // ...no&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 22:22:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825508#M100580</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-30T22:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: get legend items: no scriptable objects</title>
      <link>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825513#M100581</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/58003"&gt;@mmarchandFSLR&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;It actually does return scriptable objects.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;on the other hand ... a bit surprising:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_3-1735596775364.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71588i7B335835DC692292/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_3-1735596775364.png" alt="hogi_3-1735596775364.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;JMP19:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_4-1735596861811.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71589i0B79E8C603065989/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_4-1735596861811.png" alt="hogi_4-1735596861811.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 22:14:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/issue-with-get-legend-items/m-p/825513#M100581</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-30T22:14:50Z</dc:date>
    </item>
  </channel>
</rss>

