<?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 Gchart + Values dont Fit inside Stack Bar in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/721311#M21098</link>
    <description>&lt;P&gt;&lt;SPAN&gt;hi team,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i was able to get the vertical bar graphs using proc sgplot, now i have issue when the values are too small bar is shrinking, any suggestions please.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;proc sgplot data=sold noborder;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;styleattrs datacolors = ('#33ccff' '#ff9900' '#bfbfbf');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;vbar city / response = sales group = type seglabel groupdisplay=stack barwidth=0.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;grouporder=data baselineattrs=(thickness=0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x axis discreteorder = data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xaxis display = (noline nolabel noticks novalues);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;yaxis values = (0 to 100 by 10) display = (noline nolabel noticks novalues);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;keylegend "mybar"/title="";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;format sales dollar8.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mahesh&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="yj6qo"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Tue, 23 Feb 2021 16:00:14 GMT</pubDate>
    <dc:creator>pmksasbi</dc:creator>
    <dc:date>2021-02-23T16:00:14Z</dc:date>
    <item>
      <title>Proc Gchart + Values dont Fit inside Stack Bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/720660#M21097</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am working on creating Stacked Vertical Bar chart. and when my values are small they don't fit inside the bar. can&amp;nbsp; you please help on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code run good to this values:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data sold;&lt;/P&gt;&lt;P&gt;input city $ Sales Type$;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if type = 'customer' then color = '1';&lt;/P&gt;&lt;P&gt;else if type = 'employer' then color = '3';&lt;/P&gt;&lt;P&gt;else if type = 'manufact' then color = '2';&lt;/P&gt;&lt;P&gt;else color = '4';&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;current 40 customer&lt;/P&gt;&lt;P&gt;previos 25 manufact&lt;/P&gt;&lt;P&gt;previos 10 customer&lt;/P&gt;&lt;P&gt;previos 5 employer&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below code employer values are not shown inside the bar. Also i would like to have the dollar values inside the midddle of the bar instead on the top.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code :&lt;/P&gt;&lt;P&gt;data sold;&lt;/P&gt;&lt;P&gt;input city $ Sales Type$;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if type = 'customer' then color = '1';&lt;/P&gt;&lt;P&gt;else if type = 'employer' then color = '3';&lt;/P&gt;&lt;P&gt;else if type = 'manufact' then color = '2';&lt;/P&gt;&lt;P&gt;else color = '4';&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;current 20 customer&lt;/P&gt;&lt;P&gt;previos 12 manufact&lt;/P&gt;&lt;P&gt;previos 7 customer&lt;/P&gt;&lt;P&gt;previos 1 employer&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;goptions reset = all border cback = white hsize=6in htitle =2.0 htext =5.0 imagestyle = vsize=3in;&lt;/P&gt;&lt;P&gt;goptions device=jpeg gsfname=out;&lt;/P&gt;&lt;P&gt;goptions xpixels=550 ypixels=650;&lt;/P&gt;&lt;P&gt;ods graphics on / width =2in;&lt;/P&gt;&lt;P&gt;ods graphics / height =20in;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;ods html path = 'mypath' body="test.htm" style =htmlblue gpath = '/mypath/test.jpg';&lt;/P&gt;&lt;P&gt;pattern1 v =solid color='#33ccff';&lt;/P&gt;&lt;P&gt;pattern2 v =solid color='#ff9900';&lt;/P&gt;&lt;P&gt;pattern3 v =solid color='#bfbfbf';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc gchart data=sold;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar city/discrete sumvar=sales nozero group = city subgroup = color type = sum&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; width = 8 space =15 NOFRAME noaxis noloegend coutline = gray99 woutline =1 inside=sum;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format sales dollar8.&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS HTML CLOSE;&lt;/P&gt;&lt;P&gt;ODS LISTING;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 19:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/720660#M21097</guid>
      <dc:creator>pmksasbi</dc:creator>
      <dc:date>2021-02-20T19:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gchart + Values dont Fit inside Stack Bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/721311#M21098</link>
      <description>&lt;P&gt;&lt;SPAN&gt;hi team,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i was able to get the vertical bar graphs using proc sgplot, now i have issue when the values are too small bar is shrinking, any suggestions please.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;proc sgplot data=sold noborder;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;styleattrs datacolors = ('#33ccff' '#ff9900' '#bfbfbf');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;vbar city / response = sales group = type seglabel groupdisplay=stack barwidth=0.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;grouporder=data baselineattrs=(thickness=0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x axis discreteorder = data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xaxis display = (noline nolabel noticks novalues);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;yaxis values = (0 to 100 by 10) display = (noline nolabel noticks novalues);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;keylegend "mybar"/title="";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;format sales dollar8.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mahesh&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="yj6qo"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Feb 2021 16:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/721311#M21098</guid>
      <dc:creator>pmksasbi</dc:creator>
      <dc:date>2021-02-23T16:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gchart + Values dont Fit inside Stack Bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/721980#M21100</link>
      <description>&lt;P&gt;In your 2nd code (the sgplot version), when you say "&lt;SPAN&gt;when the values are too small bar is shrinking" I assume you mean the stacked bars are shorter than the axis space(?) ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If so, that is because you are forcing the yaxis to go from 0 to 100, even if the data values being plotted are not near 100 (as in your sample data, which the bar heights are approximately 20). It sounds like you would prefer the yaxis to auto-scale, so that it always 'fits' the data(?) If that's the case, leave out this on the yaxis definition "values = (0 to 100 by 10)".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 19:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/721980#M21100</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-02-25T19:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gchart + Values dont Fit inside Stack Bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/721988#M21101</link>
      <description>&lt;P&gt;Here is the code I would recommend, in both Gchart and SGplot (and the output they produce):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data sold;&lt;BR /&gt;input city $ Sales Type$;&lt;BR /&gt;if type = 'customer' then color = '1';&lt;BR /&gt;else if type = 'employer' then color = '3';&lt;BR /&gt;else if type = 'manufact' then color = '2';&lt;BR /&gt;else color = '4';&lt;BR /&gt;datalines;&lt;BR /&gt;current 20 customer&lt;BR /&gt;previos 12 manufact&lt;BR /&gt;previos 7 customer&lt;BR /&gt;previos 1 employer&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;goptions gunit=pct htext=11pt border xpixels=650 ypixels=600;&lt;BR /&gt;pattern1 v =solid color='#33ccff';&lt;BR /&gt;pattern2 v =solid color='#ff9900';&lt;BR /&gt;pattern3 v =solid color='#bfbfbf';&lt;/P&gt;
&lt;P&gt;title ls=1.5 "gchart";&lt;BR /&gt;proc gchart data=sold;&lt;BR /&gt;vbar city / discrete sumvar=sales nozero group=city subgroup=color type=sum&lt;BR /&gt;width=20 space=20 NOFRAME noaxis nolegend coutline=gray99 woutline=1 inside=sum;&lt;BR /&gt;format sales dollar8.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title "sgplot";&lt;BR /&gt;proc sgplot data=sold noborder noautolegend;&lt;BR /&gt;styleattrs datacolors=('#33ccff' '#ff9900' '#bfbfbf');&lt;BR /&gt;vbar city / response=sales group=type seglabel groupdisplay=stack barwidth=0.4&lt;BR /&gt;grouporder=data baselineattrs=(thickness=0);&lt;BR /&gt;xaxis discreteorder=data;&lt;BR /&gt;xaxis display=(noline nolabel noticks novalues);&lt;BR /&gt;yaxis display=(noline nolabel noticks novalues);&lt;BR /&gt;format sales dollar8.;&lt;BR /&gt;run;&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="gchart.png" style="width: 650px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55189iF29509BFACE4CD8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="gchart.png" alt="gchart.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgplot.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55190iADFAA95EB56F12C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot.png" alt="sgplot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 19:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/721988#M21101</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-02-25T19:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gchart + Values dont Fit inside Stack Bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/722020#M21103</link>
      <description>&lt;P&gt;Thank You. But there could be situation where the values could be less than dollar like .80 cents. in that situation the stacked bar doesnt show the values as they are really small.&amp;nbsp; I used &lt;STRONG&gt;seglabelfitpolicy=noclip&amp;nbsp;&lt;/STRONG&gt;and that helps. Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc sgplot data=sold noborder noautolegend;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;styleattrs datacolors=('#33ccff' '#ff9900' '#bfbfbf');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;vbar city / response=sales group=type seglabel groupdisplay=stack barwidth=0.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;grouporder=data baselineattrs=(thickness=0)&lt;STRONG&gt;seglabelfitpolicy=noclip seglabel seglabelattrs=(size=8)&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xaxis discreteorder=data;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xaxis display=(noline nolabel noticks novalues);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;yaxis display=(noline nolabel noticks novalues);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;format sales dollar8.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 00:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gchart-Values-dont-Fit-inside-Stack-Bar/m-p/722020#M21103</guid>
      <dc:creator>pmksasbi</dc:creator>
      <dc:date>2021-02-26T00:44:35Z</dc:date>
    </item>
  </channel>
</rss>

