<?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: PROC SGPLOT Justify Keylegend Text in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489220#M16823</link>
    <description>&lt;P&gt;When you say the title that appears in the keylegend, do you mean the variable name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is always a good idea to include your code and perhaps some example data.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Aug 2018 12:19:08 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-08-23T12:19:08Z</dc:date>
    <item>
      <title>PROC SGPLOT Justify Keylegend Text</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489219#M16818</link>
      <description>&lt;P&gt;I have a keylegend in an SGPLOT and I need to left justify the title that appears in the legend.&amp;nbsp; Is there a way to do that?&amp;nbsp; I can't find anything in the documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 12:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489219#M16818</guid>
      <dc:creator>bendsteel6</dc:creator>
      <dc:date>2018-08-23T12:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT Justify Keylegend Text</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489220#M16823</link>
      <description>&lt;P&gt;When you say the title that appears in the keylegend, do you mean the variable name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is always a good idea to include your code and perhaps some example data.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 12:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489220#M16823</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-23T12:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT Justify Keylegend Text</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489222#M16824</link>
      <description>Could you please share the image of the existing graph with the title and how you want the same to display. if you could also provide the code it will help you to get better response with solution.</description>
      <pubDate>Thu, 23 Aug 2018 12:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489222#M16824</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-08-23T12:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT Justify Keylegend Text</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489231#M16825</link>
      <description>&lt;P&gt;Sorry, I got lazy and hoped there would be a simple, "Oh yeah!" solution.&amp;nbsp; Here's the code below and the graph is attached.&amp;nbsp; I want to spread the KEYLEGEND title out where the "Customer Loyalty" piece of the legend title is spread out across the first 4 variables listed in the legend and have the "Dealer Performance" piece of the legend title spread out over the remaining 5 variables listed in the legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words:&lt;/P&gt;&lt;P&gt;"Customer Loyalty" spreads across OSAT, Dealer Preference, Likely to Recommend, and More Likely to Purchase&lt;/P&gt;&lt;P&gt;"Dealer Performance" spreads across WADO, TTIA, COMM, TTSE, and RSAT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;graphics&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;height&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;800&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;width&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1600&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;maxlegendarea&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;40&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;footnote&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TITLE1&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5.0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BOLD&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;f&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Thorndale AMT"&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;SEL_MGMT_GRP. - Customer Loyalty Along With Dealer Performance"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title2&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2.0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;bold&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;c&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=brown &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;SEL_MGMT_GRP. vs. National and Region"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sgplot&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=ALL_AVERAGES_XPOSED;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;vbarparm&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;category&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=level &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;response&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=value / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=entity &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;groupdisplay&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=cluster &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dataskin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=pressed&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;seglabel&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;seglabelattrs&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;weight&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=bold &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;color&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=white &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;size&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;7&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;name&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"VBAR1"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;xaxis&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;display&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(nolabel);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;yaxis&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;values&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; to &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; by &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;keylegend&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"VBAR1"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Customer Loyalty Dealer Performance"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; level in(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"National"&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"Regional"&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"Management_Group"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 12:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489231#M16825</guid>
      <dc:creator>bendsteel6</dc:creator>
      <dc:date>2018-08-23T12:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT Justify Keylegend Text</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489607#M16835</link>
      <description>&lt;P&gt;There are two ways I would see going about this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first is a really mind numbingly inefficient way and that is to add spaces in your title between the two statements until they are spaced out enough that you are satisfied.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second way would be efficient but requires knowledge of the Graph Template Language.&amp;nbsp; I don't have the data to test to make sure this runs OK, but here is what I'd do.&amp;nbsp; It essentially splits your legend into two and allows you to have two separate titles in the two pieces by using the EXCLUDE option.&amp;nbsp; This option also exists in KEYLEGEND but I don't know if there's a way to place to legends side-by-side with just SGPLOT as I'm afraid they would overlay on top of each other.&lt;/P&gt;
&lt;P&gt;Here's a reference to the GTL syntax: &lt;A href="http://support.sas.com/documentation/cdl//en/grstatgraph/69718/HTML/default/viewer.htm#n07s2oezv7f654n1xkbrqlrianbf.htm" target="_self"&gt;http://support.sas.com/documentation/cdl//en/grstatgraph/69718/HTML/default/viewer.htm#n07s2oezv7f654n1xkbrqlrianbf.htm&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods path WORK.TEMPLAT(UPDATE) SASHELP.TMPLMST (READ);
proc template;
    define statgraph barcharts;
    begingraph / designwidth=1600 designheight=800;
    
    layout lattice / rows=1 columns=1; /**This is added to give us access to the SIDEBAR block**/
        sidebar / align=bottom; /**Sidebar is the space at the bottom of the image (below the actual graph)**/
            layout gridded / rows=1 columns=2 border=true; /**This allows us to create two spaces within the sidebar**/
                /**Makes a legend on the same graph, but excludes the values you don't want under that specific title**/
                discretelegend "VBAR1" / title="Customer Loyalty" across=4 border=false exclude=('WADO' 'TTIA' 'COMM' 'TTSE' 'RSAT');
                discretelegend "VBAR1" / title="Dealer Performance" across=4 border=false exclude=('OSAT' 'Dealer Preference' 'Likely to Recommend' 'More Likely to Purchase');
            endlayout;
        endsidebar;
    
        layout overlay / 
            /*Sets up the axes*/
            xaxisopts=(display=(line ticks tickvalues)) 
            yaxisopts=(type=linear linearopts=(viewmin=0 viewmax=1 tickvaluesequence=(start=0 end=1 increment=0.1)));
            /**Barchart syntax is slightly different in GTL**/
            barchartparm category=level response=value / group=entity orient=vertical groupdisplay=cluster dataskin=pressed
                segmentlabeltype=auto segmentlabelattrs=(weight=bold color=white size=7) name="VBAR1";
        endlayout;
    endlayout;
    endgraph;
    end;
run;
ods graphics on / height=800 width=1600 maxlegendarea=40;
proc sgrender data=ALL_AVERAGES_XPOSED template=barcharts;
    where level in("National" "Regional" "Management_Group");
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Justify-Keylegend-Text/m-p/489607#M16835</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2018-08-24T14:20:32Z</dc:date>
    </item>
  </channel>
</rss>

