<?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: Bar Chart Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713137#M219950</link>
    <description>&lt;P&gt;Thank you! This works great with less work.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 17:14:26 GMT</pubDate>
    <dc:creator>luvscandy27</dc:creator>
    <dc:date>2021-01-21T17:14:26Z</dc:date>
    <item>
      <title>Bar Chart Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713090#M219935</link>
      <description>&lt;P&gt;Good morning,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to recreate a bar graph. The bar graph I would like to recreate was found at this sas website:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/35/774.html" target="_blank"&gt;https://support.sas.com/kb/35/774.html&lt;/A&gt;. You can see the full code and results by clicking the tab at the top.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code below I have replaced the data with my own and when trying to recreate the graph I get the following error:&lt;/P&gt;
&lt;DIV id="sasLogError1_1611241993605" class="sasError"&gt;ERROR: The bottom horizontal axis labeled "year" could not be fit. There was not enough room in the graph's display area to fit the group axis.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;Could someone please tell me what I need to change to get the graph to work with my data?&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;
&lt;P&gt;/* Set the graphics environment */ &lt;BR /&gt;goptions reset=all cback=white border htitle=12pt htext=10pt; &lt;BR /&gt;&lt;BR /&gt;data ds1; &lt;BR /&gt;input year $ count cum; &lt;BR /&gt;datalines; &lt;BR /&gt;2014 28683 28683 &lt;BR /&gt;2015 28219 56902 &lt;BR /&gt;2016 40644 97546 &lt;BR /&gt;2017 28179 125725 &lt;BR /&gt;2018 39876 165601&lt;BR /&gt;2019 27201 192802&lt;BR /&gt;2020 31505 224307 &lt;BR /&gt;; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data ds2; &lt;BR /&gt;set ds1; &lt;BR /&gt;n=_n_; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data _null_; &lt;BR /&gt;set ds2 end=eof; &lt;BR /&gt;if eof then call symput('skip',left(n)); &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data ds2; &lt;BR /&gt;set ds2; &lt;BR /&gt;resp=count; mid='cum'; output; &lt;BR /&gt;resp=count; mid='cum'; output; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;proc sort; &lt;BR /&gt;by year mid; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data anno; &lt;BR /&gt;set ds2; &lt;BR /&gt;by year mid; &lt;BR /&gt;length function color $8 text $20 style $ 20; &lt;BR /&gt;&lt;BR /&gt;/* Populate the table */ &lt;BR /&gt;if first.year then do; &lt;BR /&gt;function='move'; xsys='2'; ysys='1'; &lt;BR /&gt;midpoint=mid; group=year; y=0; &lt;BR /&gt;output; &lt;BR /&gt;function='cntl2txt'; output; &lt;BR /&gt;function='label'; xsys='A'; ysys='3'; &lt;BR /&gt;x=+4; y=13; &lt;BR /&gt;text=trim(left(put(exp,8.1))); &lt;BR /&gt;color='black'; position='+'; when='a'; &lt;BR /&gt;output; &lt;BR /&gt;function='move'; xsys='2'; ysys='1'; &lt;BR /&gt;midpoint=mid; group=year; y=0; &lt;BR /&gt;output; &lt;BR /&gt;function='cntl2txt'; output; &lt;BR /&gt;function='label'; xsys='A'; ysys='3'; &lt;BR /&gt;x=+4; y=9; &lt;BR /&gt;text=trim(left(put(rev,8.1))); &lt;BR /&gt;color='black'; position='+'; when='a'; &lt;BR /&gt;output; &lt;BR /&gt;end; &lt;BR /&gt;&lt;BR /&gt;/* Generate the table frame */ &lt;BR /&gt;function='move'; xsys='3'; ysys='3'; &lt;BR /&gt;x=3; y=6; &lt;BR /&gt;output; &lt;BR /&gt;function='bar'; xsys='1'; ysys='3'; &lt;BR /&gt;x=100; y=15; &lt;BR /&gt;style='empty'; color='black'; line=0; &lt;BR /&gt;output; &lt;BR /&gt;&lt;BR /&gt;/* Generate the row headers */ &lt;BR /&gt;function='label'; xsys='3'; ysys='3'; &lt;BR /&gt;style='marker'; text='U'; color='cx7c95ca'; &lt;BR /&gt;x=4; y=13; position='6'; &lt;BR /&gt;output; &lt;BR /&gt;function='label'; xsys='3'; ysys='3'; &lt;BR /&gt;style='"Albany AMT"'; text='Participant'; color='black'; &lt;BR /&gt;x=7; y=13; position='6'; &lt;BR /&gt;output; &lt;BR /&gt;function='label'; xsys='3'; ysys='3'; &lt;BR /&gt;style='marker'; text='U'; color='cxde7e6f'; &lt;BR /&gt;x=4; y=8.5; position='6'; &lt;BR /&gt;output; &lt;BR /&gt;function='label'; xsys='3'; ysys='3'; &lt;BR /&gt;style='"Albany AMT"'; text='Cumulative'; color='black'; &lt;BR /&gt;x=7; y=9; position='6'; &lt;BR /&gt;output; &lt;BR /&gt;&lt;BR /&gt;/* Generate the vertical lines in the table */ &lt;BR /&gt;function='move'; xsys='1'; ysys='1'; &lt;BR /&gt;x=0; y=0; &lt;BR /&gt;output; &lt;BR /&gt;function='draw'; xsys='1'; ysys='3'; &lt;BR /&gt;x=0; y=6; &lt;BR /&gt;line=1; color='black'; &lt;BR /&gt;output; &lt;BR /&gt;function='move'; xsys='1'; ysys='1'; &lt;BR /&gt;x=100; y=0; &lt;BR /&gt;output; &lt;BR /&gt;function='draw'; xsys='1'; ysys='3'; &lt;BR /&gt;x=100; y=6; &lt;BR /&gt;line=1; color='black'; &lt;BR /&gt;output;&lt;BR /&gt;&lt;BR /&gt;if first.year and n ^=&amp;amp;skip then do; &lt;BR /&gt;function='move'; xsys='2'; ysys='1'; &lt;BR /&gt;midpoint=mid; y=0; group=year; &lt;BR /&gt;output; &lt;BR /&gt;function='move'; xsys='A'; ysys='1'; &lt;BR /&gt;x=+15.5; x=+12; y=0; &lt;BR /&gt;output; &lt;BR /&gt;function='draw'; xsys='A'; ysys='3'; &lt;BR /&gt;x=+0; y=6; &lt;BR /&gt;color='black'; line=1; &lt;BR /&gt;output; &lt;BR /&gt;end; &lt;BR /&gt;&lt;BR /&gt;/* Generate the horizontal line in the table */ &lt;BR /&gt;function='move'; xsys='3'; ysys='3'; &lt;BR /&gt;x=3; y=10.5; &lt;BR /&gt;output; &lt;BR /&gt;function='draw'; xsys='1'; ysys='3'; &lt;BR /&gt;x=100; y=10.5; &lt;BR /&gt;line=1; color='black'; &lt;BR /&gt;output; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;title1 'Participants'; &lt;BR /&gt;&lt;BR /&gt;axis1 label=none &lt;BR /&gt;order=(0 to 250000 by 50000) &lt;BR /&gt;minor=none; &lt;BR /&gt;&lt;BR /&gt;axis2 label=none &lt;BR /&gt;value=none &lt;BR /&gt;origin=(20pct,22pct) &lt;BR /&gt;offset=(4pct,4pct); &lt;BR /&gt;&lt;BR /&gt;axis3 label=none; &lt;BR /&gt;&lt;BR /&gt;footnote1 'Fiscal Year'; &lt;BR /&gt;footnote2 h=.5 ' '; &lt;BR /&gt;&lt;BR /&gt;pattern1 value=solid color=cx7c95ca; &lt;BR /&gt;pattern2 value=solid color=cxde7e6f; &lt;BR /&gt;&lt;BR /&gt;proc gchart data=ds2; &lt;BR /&gt;vbar mid / sumvar=resp group=year &lt;BR /&gt;coutline=black patternid=midpoint &lt;BR /&gt;space=0 gspace=5 width=4 &lt;BR /&gt;cframe=white autoref clipref &lt;BR /&gt;raxis=axis1 maxis=axis2 gaxis=axis3 &lt;BR /&gt;annotate=anno; &lt;BR /&gt;run; &lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 15:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713090#M219935</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2021-01-21T15:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713102#M219937</link>
      <description>&lt;P&gt;Your specific problem is the combination of&lt;/P&gt;
&lt;P&gt;gspace=5 width=4&lt;/P&gt;
&lt;P&gt;Pick one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or perhaps move to the more recent procedures that will do a lot of what you want with a lot fewer headaches.&lt;/P&gt;
&lt;P&gt;Consider&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=ds1;
   vbar year / response=count
   ;
   xaxistable  count / label='Participants' position=bottom location=outside;
   xaxistable  cum /label='Cumulative' position=bottom location=outside;
run; 
 &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 17:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713102#M219937</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-21T17:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713135#M219948</link>
      <description>&lt;P&gt;I would highly recommend not using GCHART or GPLOT, use SGPLOT instead. They're more modern procs that generate better quality graphics and most importantly it's much easier to use.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 17:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713135#M219948</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-21T17:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713137#M219950</link>
      <description>&lt;P&gt;Thank you! This works great with less work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 17:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bar-Chart-Help/m-p/713137#M219950</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2021-01-21T17:14:26Z</dc:date>
    </item>
  </channel>
</rss>

