<?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 How do I rotate the bar values in proc SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532961#M17750</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to produce a graph like the one below. That is not my graph but just for reference.&amp;nbsp; In the graph below, the bar values are rotated vertically, I am trying to rotate my values at an angle. I read somewhere that the values will be automatically rotated to a vertical position when the values don't fit in the space, however I need to have my values rotated even though I only have 5 digits number ( for example 45,000).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I am using and I am using SAS 9.4:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=table1 noborder;&lt;BR /&gt;where label='Avg Size' and state=10;&lt;BR /&gt;format ld1 comma.;&lt;BR /&gt;vbar year/ response=ld1 datalabel datalabelattrs=(size=12)&lt;BR /&gt;barwidth =0.2&lt;BR /&gt;dataskin=gloss&lt;BR /&gt;baselineattrs=(thickness=0)&lt;BR /&gt;fillattrs=(color=green);&lt;BR /&gt;xaxis display=(nolabel noticks) ;&lt;BR /&gt;yaxis display=none ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://blogs.sas.com/content/graphicallyspeaking/files/2016/11/BarChartClusterGradient.png" border="0" alt="Image result for sgplot tilt data value on top of  bar chart" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Feb 2019 15:32:34 GMT</pubDate>
    <dc:creator>mft</dc:creator>
    <dc:date>2019-02-05T15:32:34Z</dc:date>
    <item>
      <title>How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532961#M17750</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to produce a graph like the one below. That is not my graph but just for reference.&amp;nbsp; In the graph below, the bar values are rotated vertically, I am trying to rotate my values at an angle. I read somewhere that the values will be automatically rotated to a vertical position when the values don't fit in the space, however I need to have my values rotated even though I only have 5 digits number ( for example 45,000).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I am using and I am using SAS 9.4:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=table1 noborder;&lt;BR /&gt;where label='Avg Size' and state=10;&lt;BR /&gt;format ld1 comma.;&lt;BR /&gt;vbar year/ response=ld1 datalabel datalabelattrs=(size=12)&lt;BR /&gt;barwidth =0.2&lt;BR /&gt;dataskin=gloss&lt;BR /&gt;baselineattrs=(thickness=0)&lt;BR /&gt;fillattrs=(color=green);&lt;BR /&gt;xaxis display=(nolabel noticks) ;&lt;BR /&gt;yaxis display=none ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://blogs.sas.com/content/graphicallyspeaking/files/2016/11/BarChartClusterGradient.png" border="0" alt="Image result for sgplot tilt data value on top of  bar chart" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 15:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532961#M17750</guid>
      <dc:creator>mft</dc:creator>
      <dc:date>2019-02-05T15:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532977#M17751</link>
      <description>&lt;P&gt;Hi and welcome to the SAS communities &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;datalabelfitpolicy=rotate&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the &lt;A href="https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n0p7vdd69sgf3wn1479qxqxuryrt.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p1b90um08zez8pn1gg2poj3rcuux" target="_self"&gt;VBAR Statement Options&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 15:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532977#M17751</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-02-05T15:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532981#M17752</link>
      <description>&lt;P&gt;We currently do not have a ROTATEALWAYS option for DATALABELFITPOLICY; however, if the values are close to the edge of the bars, you can make the rotation kick in by shrinking the BARWIDTH a little more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 16:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532981#M17752</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-02-05T16:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532985#M17753</link>
      <description>&lt;P&gt;I just learned something. I thought the DATALABELFITPOLICY=ROTATE would rotate the data label values no matter what.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;&amp;nbsp;thank you for clarifying. Will we see a ROTATEALWAYS Option for DATALABELFITPOLICY in a future release?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 16:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532985#M17753</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-02-05T16:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532988#M17754</link>
      <description>&lt;P&gt;We'll see what we can do &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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, 05 Feb 2019 16:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/532988#M17754</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-02-05T16:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533010#M17755</link>
      <description>&lt;P&gt;Thank you for this information!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 16:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533010#M17755</guid>
      <dc:creator>mft</dc:creator>
      <dc:date>2019-02-05T16:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533237#M17757</link>
      <description>&lt;P&gt;How about this one ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class nway;
class age sex;
var height;
output out=temp sum=;
run;
data temp;
 set temp;
 if sex='M' then h1=height;
  else h2=height;
run;

proc sgplot data=temp;
vbarparm category=age response=height  /group=sex groupdisplay=cluster ;
text x=age y=h1 text=h1/ discreteoffset=0.2 rotate=90 strip;
text x=age y=h2 text=h2/ discreteoffset=-0.2 rotate=90 strip;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533237#M17757</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-02-06T14:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533259#M17758</link>
      <description>&lt;P&gt;This should work.&amp;nbsp; I am thinking you can use TEXT statement with GROUP and GROUPDISPLAY=Cluster to match the VBARPARM.&amp;nbsp; This will make it more scale-able to different group levels.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533259#M17758</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2019-02-06T14:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rotate the bar values in proc SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533269#M17759</link>
      <description>&lt;P&gt;Thanks. As you said.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class nway;
class age sex;
var height;
output out=temp sum=;
run;


proc sgplot data=temp;
vbarparm category=age response=height  /group=sex groupdisplay=cluster ;
text x=age y=height text=height/group=sex groupdisplay=cluster rotate=90 strip;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-rotate-the-bar-values-in-proc-SGPLOT/m-p/533269#M17759</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-02-06T14:55:52Z</dc:date>
    </item>
  </channel>
</rss>

