<?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: KEYLEGEND width in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/572161#M18451</link>
    <description>&lt;P&gt;Hey Kevin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using your test program, I was not able to reproduce the problem using the latest release. What version of SAS are you running, and on what host?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;Dan&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 17:28:31 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2019-07-09T17:28:31Z</dc:date>
    <item>
      <title>KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571666#M18418</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="legend.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30812iFEE458AA2C7F6065/image-size/large?v=v2&amp;amp;px=999" role="button" title="legend.jpg" alt="legend.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I control the width of the legend when I use KEYLEGEND?&amp;nbsp; It is truncating my title when it appears that it has ample room based on the width of the plot:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  keylegend 
          / title      = "Lab Test"
            down       = 1
            linelength = 10%
            ;&lt;/PRE&gt;
&lt;P&gt;I produced the snippet of the figure using SGPLOT setting the HEIGHT and WIDTH options to the ODS GRAPHICS to 4.5in and 9.0in, respectively.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jul 2019 18:23:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571666#M18418</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2019-07-07T18:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571723#M18420</link>
      <description>&lt;P&gt;Can you please provide the SGPLOT statements you are using? This appears to work in the following example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics/reset;
proc sgplot data=sashelp.cars;
where type in ('SUV' 'Sedan' 'Wagon' 'Truck');
reg x=weight y=mpg_highway / group=type;
keylegend / title      = "Very Long Legend Title"
            down       = 1
            linelength = 10%
            ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 10:01:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571723#M18420</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-07-08T10:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571796#M18426</link>
      <description>&lt;P&gt;Rick,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thank you for your suggestion.&amp;nbsp; I have experimented more.&amp;nbsp; I used a custom style.&amp;nbsp; I found that changing the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"GraphLabelFont"      = ( "&amp;amp;font."
                        , 10pt
                        )
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to variations such as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"GraphLabelFont"      = ( "&amp;amp;font."
                        , 10pt
                        , bold
                        )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;eliminated the issue:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="legend2.jpg" style="width: 586px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30823i7506D15E0A48BA08/image-size/large?v=v2&amp;amp;px=999" role="button" title="legend2.jpg" alt="legend2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The same was true for changing just the font size to 11pt, for instance.&amp;nbsp; Surprisingly, decrease the font size to 9pt did not eliminate the issue.&amp;nbsp; Changing the fontface to "Courier New" with 10pt also eliminated the issue.&amp;nbsp; Using your code, modified to "match" my original code, I was able to replicate the issue.&amp;nbsp; Omitting the STYLE = forma option to the ODS RTF statement, the issue resolved.&amp;nbsp; The offending code that produces:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cars.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30834iD6163E1F1F1630AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="cars.jpg" alt="cars.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

ods path ( prepend )
         work.templat
         ( write )
         ;

proc template ;
  define style
         styles.forma2 / store  = work.templat
         ;
    parent = styles.pearl ;
    class GraphFonts
        / "GraphLabelFont"      = ( "Times New Roman"
                                  , 10pt
                                  , bold
                                  )
          "GraphValueFont"      = ( "Times New Roman"
                                  , 10pt
                                  )

          ;
  end ;
run ;

ods path ( remove )
         work.templat
         ;

ods path ( prepend )
         work.templat
         ( read )
         ;


ods graphics/reset;

ods graphics on 
           / width    = 9.0in
             height   = 4.5in
             noborder
    ;

ods rtf
    file        = "&amp;amp;outpath.\&amp;amp;outfile.9b.rtf"
    nogtitle
    nogfootnote
    style       = forma2
    ;

ods listing close ;
ods results ;


proc sgplot data = sashelp.cars ;
where type in ('SUV' 'Sedan' 'Wagon' 'Truck');
reg x=weight y=mpg_highway / group=type ;

keylegend / title      = "Lab Title"
            down       = 1
            linelength = 10%
            ;

  format weight       8.0 ;

run;

ods rtf close ;
ods listing ;
ods noresults ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571796#M18426</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2019-07-08T14:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571802#M18427</link>
      <description>&lt;P&gt;Thanks for the reproducible example. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;&amp;nbsp;might find your example interesting.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571802#M18427</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-07-08T14:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571824#M18429</link>
      <description>&lt;P&gt;Rick,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I understand that you were able to reproduce it?&amp;nbsp; Perhaps this is an issue with the TEMPLATE?&amp;nbsp; If so, I am looking forward to Dan's reaction, but that would seem to me that I also should open a tech support ticket? (I will have to create an account for my new employer.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571824#M18429</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2019-07-08T15:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571854#M18430</link>
      <description>&lt;P&gt;No, I did not try to reproduce it. I don't have much experience with styles.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/571854#M18430</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-07-08T16:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/572161#M18451</link>
      <description>&lt;P&gt;Hey Kevin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using your test program, I was not able to reproduce the problem using the latest release. What version of SAS are you running, and on what host?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 17:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/572161#M18451</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-07-09T17:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/573472#M18487</link>
      <description>&lt;P&gt;Thanks for the reply.&amp;nbsp; I have a ticket with&amp;nbsp;&lt;SPAN class="csbf16cdd61"&gt;Lelia McConnell of SAS Tech Support.&amp;nbsp; I was able to replicate it in RTF, but the PDF was fine.&amp;nbsp; I generated them in the same program.&amp;nbsp; She has the full log and the two output. She requested the _AUTOMATIC_ macro variables and I also provided her the SOURCE from Template.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Current version: 9.04.01M5P091317&lt;/P&gt;
&lt;P&gt;&amp;lt;SNIPPED&amp;gt;&lt;/P&gt;
&lt;P&gt;Operating System: WX64_WKS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="csbf16cdd61"&gt;I will update this thread if (when) I get an answer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="csbf16cdd61"&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="csbf16cdd61"&gt;&lt;BR /&gt;Kevin&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 12:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/573472#M18487</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2019-07-15T12:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/573521#M18491</link>
      <description>&lt;P&gt;Hey Kevin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your RTF run, try adding this to your program and see if you get the correct output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods graphics / imagefmt=png;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could be an EMF output issue. If so, using PNG should fix it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 14:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/573521#M18491</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-07-15T14:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: KEYLEGEND width</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/760739#M21831</link>
      <description>Hi Kevin,&lt;BR /&gt;&lt;BR /&gt;I am having exactly the same issue with the Keylengend title. It seems KeyLegend does not like Time New Roman font. We use SAS 9.4 on X64_SR12R2 platform. Did you get any feedback from SAS tech support on this issue?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Zhihai</description>
      <pubDate>Tue, 10 Aug 2021 19:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/KEYLEGEND-width/m-p/760739#M21831</guid>
      <dc:creator>akq08540</dc:creator>
      <dc:date>2021-08-10T19:42:55Z</dc:date>
    </item>
  </channel>
</rss>

