<?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: errorbars on subcategory of stacked vertical bar chart. in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66330#M2269</link>
    <description>Here is one way to do it with gchart and annotate...&lt;BR /&gt;
&lt;BR /&gt;
---&lt;BR /&gt;
&lt;BR /&gt;
%let name=anno002;&lt;BR /&gt;
filename odsout '.';&lt;BR /&gt;
&lt;BR /&gt;
data foo;&lt;BR /&gt;
input barmid $ 1-1 subgr $ 3-3 value err;&lt;BR /&gt;
datalines;&lt;BR /&gt;
A x 10 2&lt;BR /&gt;
A y 15 1.5&lt;BR /&gt;
A z 7 1.1&lt;BR /&gt;
C y 10 1.6&lt;BR /&gt;
C x 11 2.2&lt;BR /&gt;
C z 17 2.4&lt;BR /&gt;
B x 3 1.5&lt;BR /&gt;
B y 6 1.3&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=foo out=foo_anno;&lt;BR /&gt;
by barmid subgr;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data foo_anno; set foo_anno;&lt;BR /&gt;
by barmid;&lt;BR /&gt;
xsys='2'; ysys='2'; when='a';&lt;BR /&gt;
if first.barmid then y_base=0;&lt;BR /&gt;
y_base+value;&lt;BR /&gt;
midpoint=barmid;&lt;BR /&gt;
function='move'; y=y_base; output;&lt;BR /&gt;
function='draw'; y=y+err; output;&lt;BR /&gt;
xsys='7'; x=-1; output; x=+2; output; /* draw the 'T' across the top */&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
goptions device=png;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS HTML path=odsout body="&amp;amp;name..htm" style=sasweb;&lt;BR /&gt;
&lt;BR /&gt;
goptions gunit=pct htitle=4.5 ftitle="albany amt/bold" htext=3.0 ftext="albany amt";&lt;BR /&gt;
&lt;BR /&gt;
axis1 label=none order=(0 to 50 by 10) minor=none offset=(0,0);&lt;BR /&gt;
axis2 label=none;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=foo anno=foo_anno;&lt;BR /&gt;
vbar barmid / type=sum sumvar=value&lt;BR /&gt;
 subgroup=subgr&lt;BR /&gt;
 raxis=axis1 maxis=axis2&lt;BR /&gt;
 nolegend&lt;BR /&gt;
 width=10&lt;BR /&gt;
 coutline=graycc&lt;BR /&gt;
 des='' name="&amp;amp;name";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=foo_anno;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
ODS HTML CLOSE;&lt;BR /&gt;
ODS LISTING;</description>
    <pubDate>Tue, 24 Aug 2010 13:42:03 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2010-08-24T13:42:03Z</dc:date>
    <item>
      <title>errorbars on subcategory of stacked vertical bar chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66326#M2265</link>
      <description>Hi All , &lt;BR /&gt;
&lt;BR /&gt;
How do you create errorbars on top of each subcategory  of  stacked vertical bars . errorbar=option will not work if we use subgroup=option in proc gchart. I tried doing this using annotate dataset, but  could not coincide  on each  top of subcategory in vertical bar chart.&lt;BR /&gt;
&lt;BR /&gt;
For ex i have 3 subcategories in a single vertical bar and on each top i have to produce a T shaped errorbar on each subcategory (total 3 errorbars on one vertical bar chart) .Can anyone please help me in solving this.</description>
      <pubDate>Mon, 23 Aug 2010 13:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66326#M2265</guid>
      <dc:creator>keen_sas</dc:creator>
      <dc:date>2010-08-23T13:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: errorbars on subcategory of stacked vertical bar chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66327#M2266</link>
      <description>What version of SAS are you using?</description>
      <pubDate>Mon, 23 Aug 2010 13:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66327#M2266</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-08-23T13:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: errorbars on subcategory of stacked vertical bar chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66328#M2267</link>
      <description>I have an admitted bias against stacked histograms, I prefer GROUP= to SUBGROUP= where the error bars make more sense.  &lt;BR /&gt;
&lt;BR /&gt;
That said you should be able to calculate the height of each subgroup and therefore the location to place the bars using annotate.</description>
      <pubDate>Tue, 24 Aug 2010 05:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66328#M2267</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-08-24T05:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: errorbars on subcategory of stacked vertical bar chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66329#M2268</link>
      <description>I am using sas 8.2 version. We can define only  one group variable. I  have used both group and subgroup options. Can any one  please elaborate the method to define it.</description>
      <pubDate>Tue, 24 Aug 2010 10:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66329#M2268</guid>
      <dc:creator>keen_sas</dc:creator>
      <dc:date>2010-08-24T10:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: errorbars on subcategory of stacked vertical bar chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66330#M2269</link>
      <description>Here is one way to do it with gchart and annotate...&lt;BR /&gt;
&lt;BR /&gt;
---&lt;BR /&gt;
&lt;BR /&gt;
%let name=anno002;&lt;BR /&gt;
filename odsout '.';&lt;BR /&gt;
&lt;BR /&gt;
data foo;&lt;BR /&gt;
input barmid $ 1-1 subgr $ 3-3 value err;&lt;BR /&gt;
datalines;&lt;BR /&gt;
A x 10 2&lt;BR /&gt;
A y 15 1.5&lt;BR /&gt;
A z 7 1.1&lt;BR /&gt;
C y 10 1.6&lt;BR /&gt;
C x 11 2.2&lt;BR /&gt;
C z 17 2.4&lt;BR /&gt;
B x 3 1.5&lt;BR /&gt;
B y 6 1.3&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=foo out=foo_anno;&lt;BR /&gt;
by barmid subgr;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data foo_anno; set foo_anno;&lt;BR /&gt;
by barmid;&lt;BR /&gt;
xsys='2'; ysys='2'; when='a';&lt;BR /&gt;
if first.barmid then y_base=0;&lt;BR /&gt;
y_base+value;&lt;BR /&gt;
midpoint=barmid;&lt;BR /&gt;
function='move'; y=y_base; output;&lt;BR /&gt;
function='draw'; y=y+err; output;&lt;BR /&gt;
xsys='7'; x=-1; output; x=+2; output; /* draw the 'T' across the top */&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
goptions device=png;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS HTML path=odsout body="&amp;amp;name..htm" style=sasweb;&lt;BR /&gt;
&lt;BR /&gt;
goptions gunit=pct htitle=4.5 ftitle="albany amt/bold" htext=3.0 ftext="albany amt";&lt;BR /&gt;
&lt;BR /&gt;
axis1 label=none order=(0 to 50 by 10) minor=none offset=(0,0);&lt;BR /&gt;
axis2 label=none;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=foo anno=foo_anno;&lt;BR /&gt;
vbar barmid / type=sum sumvar=value&lt;BR /&gt;
 subgroup=subgr&lt;BR /&gt;
 raxis=axis1 maxis=axis2&lt;BR /&gt;
 nolegend&lt;BR /&gt;
 width=10&lt;BR /&gt;
 coutline=graycc&lt;BR /&gt;
 des='' name="&amp;amp;name";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=foo_anno;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
ODS HTML CLOSE;&lt;BR /&gt;
ODS LISTING;</description>
      <pubDate>Tue, 24 Aug 2010 13:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/errorbars-on-subcategory-of-stacked-vertical-bar-chart/m-p/66330#M2269</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-08-24T13:42:03Z</dc:date>
    </item>
  </channel>
</rss>

