<?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 Stacked Bar Chart in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stacked-Bar-Chart/m-p/1914#M638</link>
    <description>Assume I have a table with the following column headings: Year, Value 1, Value 2, and Group. I need a Grouped/Vertical Stacked bar chart which shows 2 bars: year (1994, 1995) for 2 Groups (0,1) and in these bars Value 1 builds the upper limit of the bar (e.g. year 1994; Value1 = 10) and Value2 should be a fration of this bar (e.g Value2 = 5 which is half of Value1 = 10). What do I click where in the Task Roles? Column to chart= Year, Group bars by = ???, Stack = Value2, Sum of = Value1, group charts by = Group. CHEERS!</description>
    <pubDate>Thu, 07 Dec 2006 01:02:33 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2006-12-07T01:02:33Z</dc:date>
    <item>
      <title>Stacked Bar Chart</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stacked-Bar-Chart/m-p/1914#M638</link>
      <description>Assume I have a table with the following column headings: Year, Value 1, Value 2, and Group. I need a Grouped/Vertical Stacked bar chart which shows 2 bars: year (1994, 1995) for 2 Groups (0,1) and in these bars Value 1 builds the upper limit of the bar (e.g. year 1994; Value1 = 10) and Value2 should be a fration of this bar (e.g Value2 = 5 which is half of Value1 = 10). What do I click where in the Task Roles? Column to chart= Year, Group bars by = ???, Stack = Value2, Sum of = Value1, group charts by = Group. CHEERS!</description>
      <pubDate>Thu, 07 Dec 2006 01:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stacked-Bar-Chart/m-p/1914#M638</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-12-07T01:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stacked-Bar-Chart/m-p/1915#M639</link>
      <description>Hi!  &lt;BR /&gt;
If your data -currently- looks like this:&lt;BR /&gt;
Year Grp Value1 Value2&lt;BR /&gt;
1994 0   200    100&lt;BR /&gt;
1994 1   140     70&lt;BR /&gt;
1995 0   150     75&lt;BR /&gt;
1995 1   160     80&lt;BR /&gt;
&lt;BR /&gt;
You would need to tranform your data in order to create the kind of chart you want (because SAS/Graph limits you to just 1 "SUM OF" variable). So, IF you transformed your data to look like this:&lt;BR /&gt;
&lt;BR /&gt;
   Year    Grp     Type     Num&lt;BR /&gt;
   1994     0     Value1    100&lt;BR /&gt;
   1994     0     Value2    100&lt;BR /&gt;
   1994     1     Value1     70&lt;BR /&gt;
   1994     1     Value2     70&lt;BR /&gt;
   1995     0     Value1     75&lt;BR /&gt;
   1995     0     Value2     75&lt;BR /&gt;
   1995     1     Value1     80&lt;BR /&gt;
   1995     1     Value2     80&lt;BR /&gt;
  &lt;BR /&gt;
Then EG and SAS/Graph will give you the output you want. Note, that if Value 1 is the total height of the bar, then you have to subtract&lt;BR /&gt;
Value 2 from Value 1 in the transformed data because SAS/Graph will want to sum on&lt;BR /&gt;
the variable for your "sum of". In this way, SAS/Graph takes care of the bar height&lt;BR /&gt;
for you. At any rate, the correct click path would be (assumes you have already created the transformed data table):&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
Start new project to transform data OR&lt;BR /&gt;
Add transformed data to project&lt;BR /&gt;
Highlight transformed data table in project&lt;BR /&gt;
Graph --&amp;gt; Bar Chart --&amp;gt; Grouped/Stacked Vertical Bar&lt;BR /&gt;
Task Roles --&amp;gt; Column to Chart = Year&lt;BR /&gt;
Task Roles --&amp;gt; Group bars by = Grp&lt;BR /&gt;
Task Roles --&amp;gt; Stack = Type&lt;BR /&gt;
Task Roles --&amp;gt; Sum of = Num&lt;BR /&gt;
Appearance --&amp;gt; Bars --&amp;gt; click on the box "Specify number of bars" and then make sure that the top radio button is checked (One bar for each unique data value).&lt;BR /&gt;
Then select --&amp;gt; RUN to create the graph&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
The issue with the data as you describe it, is that you have 2 numeric variables, Value1 and Value2 but, SAS/Graph only allows you to have 1 numeric variable for the "sum of" role. This means that you need a "Type" variable which is set to either value1 or value2 and then you need only 1 numeric variable, but the combination of Year, Grp and Type make sure that SAS/Graph uses the value for the right piece of the bar chart.&lt;BR /&gt;
   &lt;BR /&gt;
If you contact Tech Support, they can help you figure out how to transpose your data to be in the right form for SAS/Graph. You could either use PROC TRANSPOSE or you could use a DATA STEP program. Since you may need to subtract Value2 from Value1 in order to adjust Value1, that points to a DATA STEP program (which you would put into a CODE NODE in EG). Of course, if you have entered the data points into EG by typing them, then you could just readjust your input. Tech Support is really your best bet to help you with data manipulation issues in EG (or anywhere else, for that matter).&lt;BR /&gt;
  &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 07 Dec 2006 18:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stacked-Bar-Chart/m-p/1915#M639</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2006-12-07T18:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stacked-Bar-Chart/m-p/1916#M640</link>
      <description>Awesome, thanks heaps Cynthia!&lt;BR /&gt;
A</description>
      <pubDate>Thu, 14 Dec 2006 02:36:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stacked-Bar-Chart/m-p/1916#M640</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-12-14T02:36:22Z</dc:date>
    </item>
  </channel>
</rss>

