<?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 SAS Graph legend label in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Graph-legend-label/m-p/665192#M198852</link>
    <description>&lt;P&gt;I would like to get the legend label, with "Treatement" above the 2 groups "Placebo&amp;nbsp; &amp;nbsp; &amp;nbsp;30 mg BID".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the 2 figures. I want the beginning one with 'Treatment' on top.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program I have now, below, produces the latter one with 'Treatment' on the side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=all pad=(bottom=25% left=20%) uniform=all ;&lt;BR /&gt;where trtp~='';&lt;BR /&gt;*format typen type. trtan trt.;&lt;BR /&gt;vbar PARAM / response=percent group=trtpn groupdisplay=cluster name='a' /*BARWIDTH=0.8*/;&lt;BR /&gt;keylegend 'a' / location=outside position=bottom TITLE='Treatment' ;&lt;BR /&gt;xaxis display=(nolabel noticks);&lt;BR /&gt;yaxis display=all offsetmin=0.02 offsetmax=0.1 thresholdmin=1 thresholdmax=1&lt;BR /&gt;label="Response Rate (%)" values=(0 to 52 by 5) ;*valueattrs=(family=&amp;amp;font. size=8pt weight=normal);&lt;BR /&gt;format trtpn trt.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jun 2020 23:16:37 GMT</pubDate>
    <dc:creator>dantsui</dc:creator>
    <dc:date>2020-06-25T23:16:37Z</dc:date>
    <item>
      <title>SAS Graph legend label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Graph-legend-label/m-p/665192#M198852</link>
      <description>&lt;P&gt;I would like to get the legend label, with "Treatement" above the 2 groups "Placebo&amp;nbsp; &amp;nbsp; &amp;nbsp;30 mg BID".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the 2 figures. I want the beginning one with 'Treatment' on top.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program I have now, below, produces the latter one with 'Treatment' on the side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=all pad=(bottom=25% left=20%) uniform=all ;&lt;BR /&gt;where trtp~='';&lt;BR /&gt;*format typen type. trtan trt.;&lt;BR /&gt;vbar PARAM / response=percent group=trtpn groupdisplay=cluster name='a' /*BARWIDTH=0.8*/;&lt;BR /&gt;keylegend 'a' / location=outside position=bottom TITLE='Treatment' ;&lt;BR /&gt;xaxis display=(nolabel noticks);&lt;BR /&gt;yaxis display=all offsetmin=0.02 offsetmax=0.1 thresholdmin=1 thresholdmax=1&lt;BR /&gt;label="Response Rate (%)" values=(0 to 52 by 5) ;*valueattrs=(family=&amp;amp;font. size=8pt weight=normal);&lt;BR /&gt;format trtpn trt.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 23:16:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Graph-legend-label/m-p/665192#M198852</guid>
      <dc:creator>dantsui</dc:creator>
      <dc:date>2020-06-25T23:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Graph legend label</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Graph-legend-label/m-p/665196#M198855</link>
      <description>&lt;P&gt;From the documenation&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV class="xis-refProc"&gt;
&lt;DIV class="xis-procStatement"&gt;
&lt;DIV class="xis-procStatementSyntax"&gt;
&lt;DIV class="xis-syntaxDescription"&gt;
&lt;DIV class="xis-optionalArgGroup"&gt;
&lt;DIV id="p05e6s89o3soxdn1ps9lx8apbz36" class="xis-argDescriptionPair"&gt;
&lt;H4 class="xis-argument"&gt;TITLE=“&lt;SPAN class="xis-userSuppliedValue"&gt;text-string&lt;/SPAN&gt;”&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P&gt;&lt;SPAN class="xis-shortDescription"&gt;specifies a title for the legend.&lt;/SPAN&gt; &lt;SPAN class="xis-paraSimpleFirst"&gt;The title is placed to the left of the legend body, except in the following cases:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="xis-listUnordered"&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV id="n14nrpze1pni70n10o1fztgzp9ef" class="xis-item"&gt;
&lt;DIV id="p02uhz75rt3qlfn19wyfi9sqdcyr" class="xis-paraSimpleFirst"&gt;the legend contains two or more rows of items&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV id="n1paxdbs2hpmgen1wlpl30o3tq78" class="xis-item"&gt;
&lt;DIV id="n1wjvsrprduumyn1kjcwtl3y8ey4" class="xis-paraSimpleFirst"&gt;the legend title length exceeds the space that is available on the left side of the legend&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P class="xis-paraSimple"&gt;In those cases, the title is placed above the legend body.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So either have 2 or more rows by setting across=1, make the title text much longer or make the formatted text values of group variable longer to take up more space. Since most of the SAS procs will ignore trailing blanks you might be able to get that by providing leading blank characters before the actual text. If this works alignment is likely to be very iffy. The amount of space for the title this way is very dependent on the amount of space the value entries occupy. So if your formatted values for the group variables are longer you might also get what you want. I suspect physically wider graphs have more allowable space to use so that might be something else to consider.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you may want to provide your legend with no title and use an Annotate data set to place text in the right place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 23:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Graph-legend-label/m-p/665196#M198855</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-25T23:48:54Z</dc:date>
    </item>
  </channel>
</rss>

