<?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: WARNING: DISCRETELEGEND statement not under LAYOUT GLOBALLEGEND is ignored when there is a LAYOU in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WARNING-DISCRETELEGEND-statement-not-under-LAYOUT-GLOBALLEGEND/m-p/865350#M341741</link>
    <description>&lt;P&gt;I'm not sure as I have nothing to test with but I think you are running into a violation of this restriction in the Globallegend&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV id="n0778d2wh7kybzn1phdmwh5cwg53" class="xis-topic"&gt;
&lt;DIV id="n0qocpipk2n9zvn1qeemq2kio0k1" class="xis-subTopic"&gt;
&lt;DIV id="n0uu3ukkkzt13fn1vu8bnk6e0fu7" class="xis-topicContent"&gt;
&lt;DIV id="p1s9tflwupgyl8n10sg2845uv5zn" class="xis-paragraph"&gt;
&lt;DIV class="xis-listUnordered"&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV id="n09uu5o3pcgsj8n1stxv04r1m42i" class="xis-item"&gt;
&lt;DIV id="n03sg0tmdxibepn1fvo7uiiomboz" class="xis-paraSimpleFirst"&gt;The individual legends in the global legend can be arranged in a single row or a single column only.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your code is using:&lt;/P&gt;
&lt;PRE&gt;discretelegend "Day -1" "Day 3" "Day 8" "Day 15" /autoitemsize=true DISPLAYCLIPPED=true across=2;&lt;/PRE&gt;
&lt;P&gt;and I think that the across=2 is going to try to make a two column two row display for that Discretelegend. Which would place one of the "rows" or "columns" outside of the global legend.&lt;/P&gt;
&lt;P&gt;Again, I think.&lt;/P&gt;
&lt;P&gt;I would suggest testing with Across=4 as something I think should be easy to test. If that does then if you are wanting a two rwo two column appearance use two Discrete legend statements, each with the Across=2&lt;/P&gt;
&lt;PRE&gt;discretelegend "Day -1" "Day 3" /autoitemsize=true DISPLAYCLIPPED=true across=2;
discretelegend  "Day 8" "Day 15" /autoitemsize=true DISPLAYCLIPPED=true across=2;&lt;/PRE&gt;
&lt;P&gt;I think that makes two items that are single rows. Again not at all tested as I have nothing to test any similar code with.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2023 04:14:05 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-03-21T04:14:05Z</dc:date>
    <item>
      <title>WARNING: DISCRETELEGEND statement not under LAYOUT GLOBALLEGEND is ignored when there is a LAYOUT GL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-DISCRETELEGEND-statement-not-under-LAYOUT-GLOBALLEGEND/m-p/865344#M341739</link>
      <description>&lt;P&gt;This is my log an it has a warning. Who can tell me what's wrong with my program? Thank you ver much.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;WARNING is&amp;nbsp;DISCRETELEGEND statement not under LAYOUT GLOBALLEGEND is ignored when there is a LAYOUT GL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MLOGIC(FIGURE): %DO loop index variable ORD1 is now 3; loop will not iterate again.&lt;BR /&gt;SYMBOLGEN: Macro variable I resolves to 1&lt;BR /&gt;SYMBOLGEN: Macro variable ORD2MAX resolves to 1&lt;BR /&gt;SYMBOLGEN: Macro variable LORD1MAX resolves to 2&lt;BR /&gt;MLOGIC(FIGURE): %IF condition &amp;amp;i=&amp;amp;ord2max and &amp;amp;lord1max=2 is TRUE&lt;BR /&gt;MPRINT(FIGURE): proc template;&lt;BR /&gt;MPRINT(FIGURE): define statgraph linechart;&lt;BR /&gt;MPRINT(FIGURE): begingraph/border=false;&lt;BR /&gt;MPRINT(FIGURE): discreteattrmap name="level" / ignorecase=true ;&lt;BR /&gt;MPRINT(FIGURE): value "Day-1" / lineattrs=(color=blue pattern=solid);&lt;BR /&gt;MPRINT(FIGURE): value "Day 3" / lineattrs=(color=orange pattern=solid);&lt;BR /&gt;MPRINT(FIGURE): value "Day 8" / lineattrs=(color=gray pattern=solid);&lt;BR /&gt;MPRINT(FIGURE): value "Day 15" / lineattrs=(color=yellow pattern=solid);&lt;BR /&gt;MPRINT(FIGURE): enddiscreteattrmap ;&lt;BR /&gt;MPRINT(FIGURE): discreteattrvar attrvar=avisit2 var=avisit1 attrmap="level" ;&lt;BR /&gt;MPRINT(FIGURE): legendItem type=line name="Day -1" / lineattrs=(color=blue pattern=solid) label="Day -1";&lt;BR /&gt;MPRINT(FIGURE): legendItem type=line name="Day 3" / lineattrs=(color=orange pattern=solid) label="Day 3";&lt;BR /&gt;MPRINT(FIGURE): legendItem type=line name="Day 8" / lineattrs=(color=gray pattern=solid) label="Day 8";&lt;BR /&gt;MPRINT(FIGURE): legendItem type=line name="Day 15" / lineattrs=(color=yellow pattern=solid) label="Day 15";&lt;BR /&gt;MPRINT(FIGURE): layout globallegend / border=false;&lt;BR /&gt;MPRINT(FIGURE): discretelegend "Day -1" "Day 3" "Day 8" "Day 15" /autoitemsize=true DISPLAYCLIPPED=true across=2;&lt;BR /&gt;MPRINT(FIGURE): endlayout;&lt;BR /&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;BR /&gt;SYMBOLGEN: Macro variable O resolves to 1&lt;BR /&gt;SYMBOLGEN: Macro variable TITLETRT1 resolves to "0.1 mg/kg"&lt;BR /&gt;MPRINT(FIGURE): entrytitle "0.1 mg/kg";&lt;BR /&gt;MPRINT(FIGURE): layout lattice / columns = 1 rows = 2 rowdatarange=union;&lt;BR /&gt;MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold ) "Glucose Level(mmol/L)"/rotate=90 width=50&lt;BR /&gt;xspace=LAYOUTPERCENT yspace=LAYOUTPERCENT x=2 y=50 justify=center;&lt;BR /&gt;MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold ) "Hours Postdose"/ width=20 xspace=LAYOUTPERCENT&lt;BR /&gt;yspace=LAYOUTPERCENT x=50 y=8 justify=center;&lt;BR /&gt;MPRINT(FIGURE): cell;&lt;BR /&gt;MPRINT(FIGURE): layout overlay / xaxisopts=( gridattrs=(pattern=dot color=black) linearopts=(viewmax=12 viewmin=0&lt;BR /&gt;tickvaluesequence=(start=0 end=12 increment=2)) display=(ticks)) yaxisopts=(griddisplay=on gridattrs=(pattern=Solid&lt;BR /&gt;color=lightgray) ) ;&lt;BR /&gt;SYMBOLGEN: Macro variable SUB1 resolves to zzzz&lt;BR /&gt;MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold) "zzzz"/ anchor=topright width=15&lt;BR /&gt;widthunit=percent xspace=wallpercent yspace=wallpercent x=80 y=80 justify=center ;&lt;BR /&gt;MPRINT(FIGURE): seriesplot x=x1 y=y1 / name="linechart" group=avisit2 lineattrs=(thickness=2 pattern=Solid);&lt;BR /&gt;MPRINT(FIGURE): endlayout;&lt;BR /&gt;MPRINT(FIGURE): endcell;&lt;BR /&gt;MPRINT(FIGURE): cell;&lt;BR /&gt;MPRINT(FIGURE): layout overlay / xaxisopts=( gridattrs=(pattern=dot color=black) linearopts=(viewmax=12 viewmin=0&lt;BR /&gt;tickvaluesequence=(start=0 end=12 increment=2))) yaxisopts=(griddisplay=on gridattrs=(pattern=Solid color=lightgray));&lt;BR /&gt;SYMBOLGEN: Macro variable SUB2 resolves to xxxx&lt;BR /&gt;MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold) "xxxx"/ anchor=topright width=15&lt;BR /&gt;widthunit=percent xspace=wallpercent yspace=wallpercent x=80 y=80 justify=center ;&lt;BR /&gt;MPRINT(FIGURE): seriesplot x=x2 y=y2 / name="linechart" group=avisit2 lineattrs=(thickness=2 pattern=Solid);&lt;BR /&gt;MPRINT(FIGURE): discretelegend "linechart";&lt;BR /&gt;MPRINT(FIGURE): endlayout;&lt;BR /&gt;MPRINT(FIGURE): endcell;&lt;BR /&gt;MPRINT(FIGURE): endlayout;&lt;BR /&gt;MPRINT(FIGURE): endgraph;&lt;BR /&gt;MPRINT(FIGURE): end;&lt;BR /&gt;NOTE: Overwriting existing template/link: Linechart&lt;BR /&gt;NOTE: STATGRAPH 'Linechart' has been saved to: WORK.TEMPLAT&lt;BR /&gt;NOTE: PROCEDURE TEMPLATE used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MPRINT(FIGURE): run;&lt;BR /&gt;MPRINT(FIGURE): proc sgrender data=b template=linechart;&lt;BR /&gt;MPRINT(FIGURE): run;&lt;/P&gt;&lt;P&gt;WARNING: DISCRETELEGEND statement not under LAYOUT GLOBALLEGEND is ignored when there is a LAYOUT GLOBALLEGEND.&lt;BR /&gt;NOTE: This SAS session is using a registry in WORK. All changes will be lost at the end of this session.&lt;BR /&gt;NOTE: There were 90 observations read from the data set WORK.B.&lt;BR /&gt;NOTE: PROCEDURE SGRENDER used (Total process time):&lt;BR /&gt;real time 1.45 seconds&lt;BR /&gt;cpu time 0.51 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MLOGIC(FIGURE): %DO loop index variable I is now 2; loop will not iterate again.&lt;BR /&gt;MLOGIC(FIGURE): %DO loop index variable O is now 2; loop will not iterate again.&lt;BR /&gt;MLOGIC(FIGURE): Ending execution.&lt;BR /&gt;1941&lt;BR /&gt;1942 ods rtf close;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 02:42:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-DISCRETELEGEND-statement-not-under-LAYOUT-GLOBALLEGEND/m-p/865344#M341739</guid>
      <dc:creator>Stephen_Q</dc:creator>
      <dc:date>2023-03-21T02:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: DISCRETELEGEND statement not under LAYOUT GLOBALLEGEND is ignored when there is a LAYOU</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-DISCRETELEGEND-statement-not-under-LAYOUT-GLOBALLEGEND/m-p/865350#M341741</link>
      <description>&lt;P&gt;I'm not sure as I have nothing to test with but I think you are running into a violation of this restriction in the Globallegend&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV id="n0778d2wh7kybzn1phdmwh5cwg53" class="xis-topic"&gt;
&lt;DIV id="n0qocpipk2n9zvn1qeemq2kio0k1" class="xis-subTopic"&gt;
&lt;DIV id="n0uu3ukkkzt13fn1vu8bnk6e0fu7" class="xis-topicContent"&gt;
&lt;DIV id="p1s9tflwupgyl8n10sg2845uv5zn" class="xis-paragraph"&gt;
&lt;DIV class="xis-listUnordered"&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV id="n09uu5o3pcgsj8n1stxv04r1m42i" class="xis-item"&gt;
&lt;DIV id="n03sg0tmdxibepn1fvo7uiiomboz" class="xis-paraSimpleFirst"&gt;The individual legends in the global legend can be arranged in a single row or a single column only.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your code is using:&lt;/P&gt;
&lt;PRE&gt;discretelegend "Day -1" "Day 3" "Day 8" "Day 15" /autoitemsize=true DISPLAYCLIPPED=true across=2;&lt;/PRE&gt;
&lt;P&gt;and I think that the across=2 is going to try to make a two column two row display for that Discretelegend. Which would place one of the "rows" or "columns" outside of the global legend.&lt;/P&gt;
&lt;P&gt;Again, I think.&lt;/P&gt;
&lt;P&gt;I would suggest testing with Across=4 as something I think should be easy to test. If that does then if you are wanting a two rwo two column appearance use two Discrete legend statements, each with the Across=2&lt;/P&gt;
&lt;PRE&gt;discretelegend "Day -1" "Day 3" /autoitemsize=true DISPLAYCLIPPED=true across=2;
discretelegend  "Day 8" "Day 15" /autoitemsize=true DISPLAYCLIPPED=true across=2;&lt;/PRE&gt;
&lt;P&gt;I think that makes two items that are single rows. Again not at all tested as I have nothing to test any similar code with.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 04:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-DISCRETELEGEND-statement-not-under-LAYOUT-GLOBALLEGEND/m-p/865350#M341741</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-21T04:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: DISCRETELEGEND statement not under LAYOUT GLOBALLEGEND is ignored when there is a LAYOU</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-DISCRETELEGEND-statement-not-under-LAYOUT-GLOBALLEGEND/m-p/865354#M341743</link>
      <description>Thanks for your suggestion,but I testing with Across=4 also have a warning,it's the same as Across=2.</description>
      <pubDate>Tue, 21 Mar 2023 04:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-DISCRETELEGEND-statement-not-under-LAYOUT-GLOBALLEGEND/m-p/865354#M341743</guid>
      <dc:creator>Stephen_Q</dc:creator>
      <dc:date>2023-03-21T04:44:06Z</dc:date>
    </item>
  </channel>
</rss>

