<?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: How to show percentage and count on stacked bar chart in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624302#M20081</link>
    <description>&lt;P&gt;thank you! it is works!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I edited it!&lt;/SPAN&gt; Thank you for you reminding me!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 19:16:04 GMT</pubDate>
    <dc:creator>babykxy</dc:creator>
    <dc:date>2020-02-12T19:16:04Z</dc:date>
    <item>
      <title>How to show percentage and count on stacked bar chart</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624271#M20078</link>
      <description>&lt;P&gt;I want to generate a bar chart show percentage and count in bar plot. as below image&lt;/P&gt;&lt;P&gt;I&amp;nbsp; also want date variable as order.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data plot1 ;
input month $1-10 year $10-14 L2011_12 16-19 L2011_3 20-22 L2014_12 23-27 L2014_3 29-32 L2017 35-38 NYS 39-44 ;
datalines;
March     2018	24	25	187	8455	20	0	  
June      2018	2	5	136	8907	42	0	  
September 2018	14	7	135	8597	73	74	   
December  2018	0	0	134	7930	73	613 	
March     2019	0	0	139	7446	77	1454	
;
run;

proc sort data= plot1; by year month; run;
proc transpose data=plot1 out=long1;
by year month; run;
data long2;
set long1;
date= month||year; run;
 
proc sgplot data =long2 noborder;
styleattrs datacolors=(Firebrick big vpap deepskyblue ) ;
vbar date / response= col1
group=_NAME_ fill barwidth=0.4 seglabel seglabelattrs=(color=black size=8 )
seglabel datalabel
baselineattrs=(thickness=0)
outlineattrs=(color=cx3f3f3f);
xaxis display=(nolabel noline noticks);
yaxis display=(noline noticks) grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="doc.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36076i1376F4E8D16D1E9A/image-size/large?v=v2&amp;amp;px=999" role="button" title="doc.png" alt="doc.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 19:11:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624271#M20078</guid>
      <dc:creator>babykxy</dc:creator>
      <dc:date>2020-02-12T19:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to show percentage and count on stacked bar chart</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624292#M20080</link>
      <description>&lt;P&gt;Please post code in to a code box opened on the forum with the {I}, especially a data step that reads fixed column data. The message windows remove white space and may insert other characters so that the data step as posted will not run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create an actual DATE valued variable so that things will sort properly, apply a format you want:&lt;/P&gt;
&lt;PRE&gt;data example;
   month='September';
   year ='2018';
   date = input (catx(' ','1',month,year),anydtdte18.);
   format date monyy7.;
run;&lt;/PRE&gt;
&lt;P&gt;If you start using the full month name the width of the text may have issues fitting depending on the actual months involved and how many are involved.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:52:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624292#M20080</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-12T18:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to show percentage and count on stacked bar chart</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624302#M20081</link>
      <description>&lt;P&gt;thank you! it is works!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I edited it!&lt;/SPAN&gt; Thank you for you reminding me!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 19:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624302#M20081</guid>
      <dc:creator>babykxy</dc:creator>
      <dc:date>2020-02-12T19:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to show percentage and count on stacked bar chart</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624375#M20091</link>
      <description>&lt;P&gt;What percentages do you expect to show? You will likely need to add something to the data and display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 00:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624375#M20091</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-13T00:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to show percentage and count on stacked bar chart</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624582#M20125</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data ;
input  month $1-10 year $10-14 level $15-24  count 28-34 precent 35-42;
datalines;
March     2018	L2011_12	24	  0.003
March     2018	L2011_3	    25	  0.003
March     2018	L2014_12	187	  0.021
March     2018	L2014_3	    8455  0.971
March     2018	L2017	    20	  0.002
March     2018	NYSPCMH	    0	  0
June      2018	L2011_12	2	  0
June      2018	L2011_3	    5	  0.001
June      2018	L2014_12	136	  0.015
June      2018	L2014_3	    8907  0.98
June      2018	L2017	    42	  0.005
June      2018	NYSPCMH  	0	  0
September 2018	L2011_12	14	  0.002
September 2018	L2011_3	    7	  0.001
September 2018	L2014_12	135	  0.015
September 2018	L2014_3	    8597  0.966
September 2018	L2017	    73	  0.008
September 2018	NYSPCMH	    74	  0.008
December  2018	L2011_12	0	  0
December  2018	L2011_3	    0	  0
December  2018	L2014_12	134	  0.015
December  2018	L2014_3	    7930  0.906
December  2018	L2017	    73	  0.008
December  2018	NYSPCMH	    613	  0.07
March     2019	L2011_12	0	  0
March     2019	L2011_3	    0	  0
March     2019	L2014_12	139	  0.015
March     2019	L2014_3  	7446  0.817
March     2019	L2017	    77	  0.008
March     2019	NYSPCMH	    1454  0.159
;

data data1(drop = month year);
  set  data  ;
   date = input (catx(' ','1',month,year),anydtdte18.);
   format date monyy7.; 
format precent percent10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;thank you for helping!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 18:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-show-percentage-and-count-on-stacked-bar-chart/m-p/624582#M20125</guid>
      <dc:creator>babykxy</dc:creator>
      <dc:date>2020-02-13T18:50:01Z</dc:date>
    </item>
  </channel>
</rss>

