<?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: Producing stacked bar chart in SAS EG in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444194#M15284</link>
    <description>&lt;P&gt;I can't guess why you are using a SERIES statement to create stacked bars.&amp;nbsp; See "&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/12/05/getting-started-sgplot-index/" target="_blank"&gt;Getting Started&lt;/A&gt;" section in Graphically Speaking for many examples of how SAS procedures work.&amp;nbsp; It may not help to try to use Excel methodology with SAS.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Mar 2018 17:53:04 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2018-03-09T17:53:04Z</dc:date>
    <item>
      <title>Producing stacked bar chart in SAS EG</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444167#M15281</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to produce the stacked bar chart using the below data but not able to achieve the desired results. I'm getting the desired graph in the excel without any issue. Please help.&lt;/P&gt;
&lt;P&gt;Tenure 1 Yr&amp;nbsp; &amp;nbsp; 2 yr&amp;nbsp; &amp;nbsp; 3 Yr&amp;nbsp; &amp;nbsp;4 Yr&amp;nbsp; &amp;nbsp;5 Yr&amp;nbsp; &amp;nbsp;6 to 10 yr&amp;nbsp; &amp;nbsp;over 10yrs&lt;/P&gt;
&lt;P&gt;prct&amp;nbsp; &amp;nbsp; &amp;nbsp; 9.00&amp;nbsp; &amp;nbsp; &amp;nbsp;8.00&amp;nbsp; &amp;nbsp; 7.00&amp;nbsp; &amp;nbsp;6.00&amp;nbsp; 6.00&amp;nbsp; &amp;nbsp; 24.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 41.00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have Attached the graph produced through excel. I'm trying to achieve same using the SAS. Tried proc gchart but not working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 16:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444167#M15281</guid>
      <dc:creator>Ch_ndra</dc:creator>
      <dc:date>2018-03-09T16:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Producing stacked bar chart in SAS EG</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444182#M15282</link>
      <description>&lt;P&gt;SAS does not work like Excel.&amp;nbsp; You will need to transform your data structure from multi-column to classified.&amp;nbsp; You need data as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Category&amp;nbsp; &amp;nbsp;Tenure&amp;nbsp; Value&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 Yr&amp;nbsp; &amp;nbsp; &amp;nbsp; 9.0&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 Yr&amp;nbsp; &amp;nbsp; &amp;nbsp; 8.0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and so on.&amp;nbsp; Then, you can use the following statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data= &amp;lt;your dataset&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; vbar&amp;nbsp; Category&amp;nbsp; / Response=value Group=Tenure;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can have additional categories to get multiple stacked bars.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See:&amp;nbsp;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2013/09/07/bar-charts-with-stacked-and-cluster-groups/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2013/09/07/bar-charts-with-stacked-and-cluster-groups/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 16:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444182#M15282</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-03-09T16:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Producing stacked bar chart in SAS EG</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444187#M15283</link>
      <description>&lt;P&gt;Thanks Sanjay. I was trying it in different way like below. I was able to stack the bars but I'm seeing gap between the bars. Not sure why.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=totacct_tenure2;&lt;BR /&gt; title 'Distribution of Accounts by Tenure';&lt;BR /&gt; series x= Tenure y='1 yr'n /lineattrs=(color= Blue thickness=30 ) ;&lt;BR /&gt; series x= Tenure y='2 yr'n / lineattrs=(color= '#13478C' thickness=15 );&lt;BR /&gt; series x= Tenure y='3 yr'n / lineattrs=(color='#90EE90' thickness=15);&lt;BR /&gt; series x= Tenure y='4 yr'n / lineattrs=(color= yellow thickness=15);&lt;BR /&gt; series x= Tenure y='5 yr'n / lineattrs=(color= black thickness=15);&lt;BR /&gt; series x= Tenure y='6 to 10 yrs'n / lineattrs=(color=brown thickness=15);&lt;BR /&gt; series x= Tenure y='over 10 yrs'n / lineattrs=(color= pink thickness=15);&lt;BR /&gt; keylegend / location=Outside Position=right down=7 ;&lt;BR /&gt; yaxis label= "Percentage" grid values=( 0 to 100 by 10 ) ;&lt;BR /&gt; Xaxis label="% of Accounts";&lt;BR /&gt; run;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 17:16:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444187#M15283</guid>
      <dc:creator>Ch_ndra</dc:creator>
      <dc:date>2018-03-09T17:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Producing stacked bar chart in SAS EG</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444194#M15284</link>
      <description>&lt;P&gt;I can't guess why you are using a SERIES statement to create stacked bars.&amp;nbsp; See "&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/12/05/getting-started-sgplot-index/" target="_blank"&gt;Getting Started&lt;/A&gt;" section in Graphically Speaking for many examples of how SAS procedures work.&amp;nbsp; It may not help to try to use Excel methodology with SAS.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 17:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Producing-stacked-bar-chart-in-SAS-EG/m-p/444194#M15284</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-03-09T17:53:04Z</dc:date>
    </item>
  </channel>
</rss>

