<?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: legend angle(rotate) by sgrender in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972898#M25632</link>
    <description>&lt;P&gt;I want to set text vertically&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2025 18:51:41 GMT</pubDate>
    <dc:creator>TimurShangareev</dc:creator>
    <dc:date>2025-08-19T18:51:41Z</dc:date>
    <item>
      <title>legend angle(rotate) by sgrender</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972895#M25630</link>
      <description>&lt;P&gt;I try to create template for&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SGRENDER DATA=INDS TEMPLATE=myTemplate;&lt;/PRE&gt;&lt;P&gt;I want to rotate legend (by Default it Horizontal in any position),&amp;nbsp; but can't find option.&lt;/P&gt;&lt;P&gt;I found ODS LEGEND, but it seems like it's working for PROC GPLOT.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there exist such option or another method to rotate legend in SGRENDER?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 18:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972895#M25630</guid>
      <dc:creator>TimurShangareev</dc:creator>
      <dc:date>2025-08-19T18:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: legend angle(rotate) by sgrender</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972897#M25631</link>
      <description>Can you clarify? You want the text running vertically or you want the items in the legend to be in rows instead of columns?</description>
      <pubDate>Tue, 19 Aug 2025 18:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972897#M25631</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2025-08-19T18:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: legend angle(rotate) by sgrender</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972898#M25632</link>
      <description>&lt;P&gt;I want to set text vertically&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 18:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972898#M25632</guid>
      <dc:creator>TimurShangareev</dc:creator>
      <dc:date>2025-08-19T18:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: legend angle(rotate) by sgrender</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972899#M25633</link>
      <description>To my knowledge there is no default option to build a legend vertically. It would require you to manually make it using something like a layout gridded combined with Entry statements (which have a rotate option) with legend items that match your graph. You would have to set the valueattrs to be size 1 and white to hide the normal legend text. This would be more complicated if not doing a bar or scatter plot as a line legend for series would also not be rotated and you would have to use annotation (drawline) to do so. If I have free time later I can make an example.</description>
      <pubDate>Tue, 19 Aug 2025 18:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972899#M25633</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2025-08-19T18:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: legend angle(rotate) by sgrender</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972951#M25635</link>
      <description>&lt;P&gt;I did not see an option you could do that either.&lt;/P&gt;
&lt;P&gt;The workaround way I could image is using PROC SGPLOT to make a picture for LEGEND and insert this picture into PROC SGRENDER by rotating it 90 degree.&lt;/P&gt;
&lt;P&gt;But that would cost you a lot of time and you need to make legend be consistent with original graph.&lt;/P&gt;
&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let path=%sysfunc(pathname(work));  *the path stored the picture ;




*Make a picture for Legend;
data x;
input label $ x y s_male_x s_male_y male $ male_x male_y s_female_x s_female_y female $  female_x female_y;
cards;
SEX      0 0  1 0  Male   1.5  0   2.5  0  Female   3.2 0
;
run;
title;
ods listing gpath="&amp;amp;path." style=htmlblue image_dpi=300;
ods graphics/width=250px height=40px reset=index imagename='legend' outputfmt=png noborder;
proc sgplot data=x noautolegend pad=0; *noborder;
scatter x=x y=y/markerchar=label markercharattrs=(size=20);

scatter x=s_male_x y=s_male_y/markerattrs=graphdata1(symbol=squarefilled size=20);
scatter x=male_x y=male_y/markerchar=male markercharattrs=(size=20);

scatter x=s_female_x y=s_female_y/markerattrs=graphdata2(symbol=squarefilled size=20);
scatter x=female_x y=female_y/markerchar=female markercharattrs=(size=20);

xaxis display=none;
yaxis display=none;
run;




%sganno
data sganno;
 %SGIMAGE(
     IMAGE="&amp;amp;path.\legend1.png",
     ANCHOR="CENTER" ,
	 IMAGESCALE="FITHEIGHT",
	 ROTATE=90,
	 HEIGHT=10,
     HEIGHTUNIT= "PERCENT",
     LAYER="FRONT",

     DRAWSPACE="WALLPERCENT",
     X1=5,
     Y1=65,ID="BAR"
     )
run;


proc template;
define statgraph y2axis;
begingraph;

layout overlay   ;
barchart category=age response=weight/group=sex groupdisplay=cluster ;
annotate / id="BAR";
endlayout;

endgraph;
end;
run;
ods graphics/reset=all;
proc sgrender data=sashelp.class template=y2axis sganno=sganno;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1755677861345.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109130iB5DA027D21AA68BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1755677861345.png" alt="Ksharp_0-1755677861345.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 08:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/legend-angle-rotate-by-sgrender/m-p/972951#M25635</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-08-20T08:29:57Z</dc:date>
    </item>
  </channel>
</rss>

