<?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: vbar graphs (that are not stacked) in sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36384#M1148</link>
    <description>Can you attach an image to indicate what you want?</description>
    <pubDate>Fri, 19 Nov 2010 15:02:31 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2010-11-19T15:02:31Z</dc:date>
    <item>
      <title>vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36379#M1143</link>
      <description>Hello all;&lt;BR /&gt;
The first question is, &lt;BR /&gt;
how do I create a vertical bar graph that consists of multiple groups (RN, MD, RT,etc), ordered by month that the different groups don't end up stacked, but rather next to each other as I get when I perform such code:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sgplot data=AGGREGATEG;&lt;BR /&gt;
vbar fx/ response=compliance group=type;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The goal is  that the compliance is the Y axis, the months are the X axis with the groups in 4 different vertical bars. &lt;BR /&gt;
&lt;BR /&gt;
Some observations below:&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Lawrence&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
       Obs     fx      COMPLIANCE    DENOMS    NUMY    TYPE&lt;BR /&gt;
&lt;BR /&gt;
        1    JUL10      0.81250        32      26      RN&lt;BR /&gt;
        2    AUG10      0.91525        59      54      RN&lt;BR /&gt;
        3    SEP10      0.58209       134      78      RN&lt;BR /&gt;
        4    OCT10      0.43750        80      35      RN&lt;BR /&gt;
        5    JUL10      0.60000         5       3      MD&lt;BR /&gt;
        6    AUG10      0.40000        10       4      MD&lt;BR /&gt;
        7    SEP10      0.42373        59      25      MD&lt;BR /&gt;
        8    OCT10      0.30667        75      23      MD&lt;BR /&gt;
        9    JUL10      0.00000         2       0      RT&lt;BR /&gt;
       10    AUG10      0.66667         3       2      RT&lt;BR /&gt;
       11    SEP10      1.00000         2       2      RT&lt;BR /&gt;
       12    OCT10      0.66667         3       2      RT&lt;BR /&gt;
       13    JUL10      0.81250        16      13      OT&lt;BR /&gt;
       14    AUG10      0.85000        20      17      OT&lt;BR /&gt;
       15    SEP10      0.23913        46      11      OT&lt;BR /&gt;
       16    OCT10      0.48485        33      16      OT</description>
      <pubDate>Thu, 18 Nov 2010 18:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36379#M1143</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2010-11-18T18:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36380#M1144</link>
      <description>Sounds like you want a "grouped bar chart" ... I would recommend using good-old "proc gchart" - perhaps something like the following:&lt;BR /&gt;
&lt;BR /&gt;
data mydata;&lt;BR /&gt;
length type $2.;&lt;BR /&gt;
format fx monyy7.;&lt;BR /&gt;
format compliance percent7.0;&lt;BR /&gt;
input fx date7. compliance denoms numy type;&lt;BR /&gt;
datalines;&lt;BR /&gt;
15JUL10      0.81250        32      26      RN&lt;BR /&gt;
15AUG10      0.91525        59      54      RN&lt;BR /&gt;
15SEP10      0.58209       134      78      RN&lt;BR /&gt;
15OCT10      0.43750        80      35      RN&lt;BR /&gt;
15JUL10      0.60000         5       3      MD&lt;BR /&gt;
15AUG10      0.40000        10       4      MD&lt;BR /&gt;
15SEP10      0.42373        59      25      MD&lt;BR /&gt;
15OCT10      0.30667        75      23      MD&lt;BR /&gt;
15JUL10      0.00000         2       0      RT&lt;BR /&gt;
15AUG10      0.66667         3       2      RT&lt;BR /&gt;
15SEP10      1.00000         2       2      RT&lt;BR /&gt;
15OCT10      0.66667         3       2      RT&lt;BR /&gt;
15JUL10      0.81250        16      13      OT&lt;BR /&gt;
15AUG10      0.85000        20      17      OT&lt;BR /&gt;
15SEP10      0.23913        46      11      OT&lt;BR /&gt;
15OCT10      0.48485        33      16      OT&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
axis1 label=('Compliance') order=(0 to 1 by .2) minor=none offset=(0,0);&lt;BR /&gt;
axis2 label=none offset=(3,3);&lt;BR /&gt;
axis3 label=none;&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=mydata;&lt;BR /&gt;
vbar type / discrete type=sum sumvar=compliance&lt;BR /&gt;
 group=fx raxis=axis1 maxis=axis2 gaxis=axis3;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 18 Nov 2010 19:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36380#M1144</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-11-18T19:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36381#M1145</link>
      <description>Here are a few variations you can use using SGPANEL:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgpanel data=AGGREGATEG;&lt;BR /&gt;
panelby type / onepanel noborder layout=columnlattice;&lt;BR /&gt;
vbar fx/ response=compliance;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgpanel data=AGGREGATEG;&lt;BR /&gt;
panelby type / onepanel noborder layout=rowlattice;&lt;BR /&gt;
hbar fx/ response=compliance;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgpanel data=AGGREGATEG;&lt;BR /&gt;
panelby type; /* optionally add ROWS, COLUMNS, or ONEPANEL */&lt;BR /&gt;
vbar fx/ response=compliance;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
For the first two, you can also move the header down and use a legend:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgpanel data=AGGREGATEG;&lt;BR /&gt;
panelby type / onepanel noborder layout=columnlattice colheaderpos=bottom;&lt;BR /&gt;
vbar fx/ response=compliance group=type;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sgpanel data=AGGREGATEG;&lt;BR /&gt;
panelby type / onepanel noborder layout=rowlattice rowheaderpos=left;&lt;BR /&gt;
hbar fx/ response=compliance group=type;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Let me know if this is what you're after.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Thu, 18 Nov 2010 20:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36381#M1145</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-11-18T20:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36382#M1146</link>
      <description>Dan &amp;amp; Robert;&lt;BR /&gt;
Thank you both for your suggestions. It gets me going but I am going to have to do a lot of manipulations...&lt;BR /&gt;
&lt;BR /&gt;
But Robert, or Dan&lt;BR /&gt;
&lt;BR /&gt;
so I am going to have an compliance overall rate at some juncture as a vline with the datalabels in  big fat yellow bubbles connected by a line. I'd rather concatenate the overall rate with the month but mgmt will not go along with that idea.&lt;BR /&gt;
&lt;BR /&gt;
I am just attempting to free up the other analyst, as the data above represents only 1 of 40 units that have to be graphed in Excel manually.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Lawrence</description>
      <pubDate>Thu, 18 Nov 2010 21:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36382#M1146</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2010-11-18T21:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36383#M1147</link>
      <description>You can do that in 'gchart' using annotate.&lt;BR /&gt;
&lt;BR /&gt;
The yellow bubble can be done with function='pie' and the text can be done with function='label'.</description>
      <pubDate>Fri, 19 Nov 2010 13:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36383#M1147</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-11-19T13:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36384#M1148</link>
      <description>Can you attach an image to indicate what you want?</description>
      <pubDate>Fri, 19 Nov 2010 15:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36384#M1148</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2010-11-19T15:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36385#M1149</link>
      <description>Thanks Robert!</description>
      <pubDate>Fri, 19 Nov 2010 15:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36385#M1149</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2010-11-19T15:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: vbar graphs (that are not stacked) in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36386#M1150</link>
      <description>Sanjay;&lt;BR /&gt;
I wish I could do that, but this forum does not allow for that..</description>
      <pubDate>Fri, 19 Nov 2010 15:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/vbar-graphs-that-are-not-stacked-in-sgplot/m-p/36386#M1150</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2010-11-19T15:28:38Z</dc:date>
    </item>
  </channel>
</rss>

