<?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 Label Font Size in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/621145#M19378</link>
    <description>&lt;P&gt;Hi....I am trying to create bar graphs that have both the counts and percentages on the graphs. The problem I am having is the font size on each bar is too small. Is there a way to specifiy the font size or height for the bar labels. Also, I am creating separate bar graphs for each question, is it possible to label the question inside the graph rather than outside the graph and a border. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Axis1 style=1 width=1 minor=none label=(height=9pt font="arial/bold" angle=90  "Percent") value=(height=9pt font="arial" "0%" "10%" "20%" "30%" "40%" "50%" "60%" "70%" "80%" "90%" "100%");
Axis2 style=1 width=2 label=(height=9pt font="arial/bold"   "Response") value=(height=9pt font="arial");
Axis3 label=(height=9pt font="arial/bold"   "Term") value=(height=9pt font="arial");
title;
title1 "PT Survey Data Bar Chart";
footnote;

proc gchart data=Want7;
	vbar Response / discrete group=Term type=percent inside=pct  outside=freq nolegend g100
		coutline=black raxis=axis1 maxis=axis2 gaxis=axis3 woutline=1 patternid=midpoint width=20;
	by Question ;
run; 
quit;

Output:

Question=My experience with course content and the learning environment. - The course content was interesting.




&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dr.png" style="width: 577px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35755i5301944F4FEC18A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="dr.png" alt="dr.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2020 14:06:08 GMT</pubDate>
    <dc:creator>twildone</dc:creator>
    <dc:date>2020-01-30T14:06:08Z</dc:date>
    <item>
      <title>re: Bar Label Font Size</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/621145#M19378</link>
      <description>&lt;P&gt;Hi....I am trying to create bar graphs that have both the counts and percentages on the graphs. The problem I am having is the font size on each bar is too small. Is there a way to specifiy the font size or height for the bar labels. Also, I am creating separate bar graphs for each question, is it possible to label the question inside the graph rather than outside the graph and a border. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Axis1 style=1 width=1 minor=none label=(height=9pt font="arial/bold" angle=90  "Percent") value=(height=9pt font="arial" "0%" "10%" "20%" "30%" "40%" "50%" "60%" "70%" "80%" "90%" "100%");
Axis2 style=1 width=2 label=(height=9pt font="arial/bold"   "Response") value=(height=9pt font="arial");
Axis3 label=(height=9pt font="arial/bold"   "Term") value=(height=9pt font="arial");
title;
title1 "PT Survey Data Bar Chart";
footnote;

proc gchart data=Want7;
	vbar Response / discrete group=Term type=percent inside=pct  outside=freq nolegend g100
		coutline=black raxis=axis1 maxis=axis2 gaxis=axis3 woutline=1 patternid=midpoint width=20;
	by Question ;
run; 
quit;

Output:

Question=My experience with course content and the learning environment. - The course content was interesting.




&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dr.png" style="width: 577px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35755i5301944F4FEC18A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="dr.png" alt="dr.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/621145#M19378</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-01-30T14:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: re: Bar Label Font Size</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/637284#M19717</link>
      <description>&lt;P&gt;SGPLOT VBAR can produce a G100 vbar chart.&amp;nbsp; &amp;nbsp;The proc option PCTLEVEL controls how the VBAR PERCENT is computed.&amp;nbsp; The SGPLOT vbar category is &lt;STRONG&gt;term&lt;/STRONG&gt; instead of&amp;nbsp; &lt;STRONG&gt;response&lt;/STRONG&gt; that is used in&amp;nbsp;GCHART vbar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;I used the variable name&amp;nbsp;&lt;STRONG&gt;answer&lt;/STRONG&gt; instead of&amp;nbsp;&lt;STRONG&gt;response&lt;/STRONG&gt;.&amp;nbsp; This was done to help avoid any mindset confusion with the vbar option&amp;nbsp;&lt;STRONG&gt;response=.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The data is pre-counted answers.&amp;nbsp;&amp;nbsp;Small changes would be needed if the plot data set is one row per respondent (i.e. raw/unsummarized).&lt;/P&gt;
&lt;P&gt;option DATALABELATTRS= is used to increase the bar data font size.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have (label="Survey summary count");
question = 'One';
length Term $20 Answer $10;
input term &amp;amp; answer &amp;amp; count;
if term ne lag(term) then answer_seq=1; else answer_seq+1;
datalines;
Fall 2018  Disagree  4
Fall 2018  Neutral   36
Fall 2018  Agree     160
Spring 2019  Disagree  6
Spring 2019  Neutral  24
Spring 2019  Agree  70
;

ods html file='vbar.html';

title "Survey chart";

data need;
  set have;
  count_as_label = count;   * separate var neeed because count is also response=;
run;

proc sgplot data=need pctlevel=group;
  by question;
  vbar term / 
    response=count
    group=answer 
    groupdisplay=cluster
    grouporder=data
    barwidth=0.85
    stat=percent
    datalabel=count_as_label
    datalabel=answer
    datalabelattrs=(size=11pt)

  ;
  xaxis labelpos=right display=(noticks)  ;*tickstyle=inside;
  yaxis display=(nolabel) values=(0 to 1 by .1) offsetmin=0.07;
  keylegend / location=inside position=bottom title="";
run;

ods _all_ close;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgplot vbar g100.png" style="width: 642px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37757iC65ACA882DB10DBF/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot vbar g100.png" alt="sgplot vbar g100.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 14:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/637284#M19717</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-04-03T14:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: re: Bar Label Font Size</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/637929#M19727</link>
      <description>&lt;P&gt;Is your value=(height=9pt) not affecting the text size? Have you tried a larger value there?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 19:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/637929#M19727</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-04-06T19:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: re: Bar Label Font Size</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/637939#M19728</link>
      <description>&lt;P&gt;Yes...I tried a larger and smaller value and nothing would change.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 20:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/re-Bar-Label-Font-Size/m-p/637939#M19728</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-04-06T20:35:21Z</dc:date>
    </item>
  </channel>
</rss>

