<?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: Annotate SGPANEL or similar in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91661#M3408</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't really have any examples like this, with a grouped bar chart (the annotate coordinates for a&amp;nbsp; grouped bar chart are a little tricker than for regular bar charts or gplots), therefore I wrote one to produce this specific chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let name=grouped_bar_table;&lt;BR /&gt;filename odsout '.';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt; value bartxt&lt;BR /&gt; 1 = 'None\of the time'&lt;BR /&gt; 2 = 'Some\of the time'&lt;BR /&gt; 3 = 'Half\of the time'&lt;BR /&gt; 4 = 'Most\of the time'&lt;BR /&gt; 5 = 'All\of the time'&lt;BR /&gt; ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data my_data;&lt;BR /&gt;format group_num bartxt.;&lt;BR /&gt;input group_num bar_num percent_of_subjects;&lt;BR /&gt;datalines;&lt;BR /&gt;1 1 .94&lt;BR /&gt;1 2 .96&lt;BR /&gt;2 1 .04&lt;BR /&gt;2 2 .02&lt;BR /&gt;3 1 .00&lt;BR /&gt;3 2 .00&lt;BR /&gt;4 1 .00&lt;BR /&gt;4 2 .01&lt;BR /&gt;5 1 .02&lt;BR /&gt;5 2 .01&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* determine how many groups, to determine geometry of table */&lt;BR /&gt;proc sql;&lt;BR /&gt;select count(unique(group_num)) into :groups from my_data;&lt;BR /&gt;quit; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_table_lines;&lt;BR /&gt;length function color $8 text $50;&lt;BR /&gt;xsys='1'; hsys='3'; when='a'; color='black';&lt;BR /&gt;/* draw the table lines going up/down */&lt;BR /&gt;do x=0 to 100 by (100/&amp;amp;groups);&lt;BR /&gt; ysys='1'; y=0; function='move'; output;&lt;BR /&gt; ysys='3'; y=2; function='draw'; size=.001; output;&lt;BR /&gt; end;&lt;BR /&gt;/* draw the table lines going across */&lt;BR /&gt;ysys='3';&lt;BR /&gt;x=0; y=14; function='move'; output;&lt;BR /&gt;x=100; function='draw'; output;&lt;BR /&gt;x=0; y=8; function='move'; output;&lt;BR /&gt;x=100; function='draw'; output;&lt;BR /&gt;x=0; y=2; function='move'; output;&lt;BR /&gt;x=100; function='draw'; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_table_numbers; set my_data;&lt;BR /&gt;length function color $8 text $50;&lt;BR /&gt;function='label'; position='5'; color='black';&lt;BR /&gt;xsys='1'; x=group_num*(100/&amp;amp;groups)-(100/&amp;amp;groups/2);&lt;BR /&gt;ysys='3';&lt;BR /&gt;if bar_num=1 then do;&lt;BR /&gt; y=11; text=put(percent_of_subjects,percentn7.0); output;&lt;BR /&gt; end;&lt;BR /&gt;if bar_num=2 then do;&lt;BR /&gt; y=5; text=put(percent_of_subjects,percentn7.0); output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_table; set anno_table_lines anno_table_numbers;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions device=png;&lt;BR /&gt;goptions noborder;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS LISTING CLOSE;&lt;BR /&gt;ODS HTML path=odsout body="&amp;amp;name..htm"&lt;BR /&gt; (title="Frequence of Spectacle Wear") style=sasweb;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions gunit=pct htitle=3.5 ftitle="albany amt/bold" htext=2.7 ftext="albany amt/bold";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pattern1 v=s c=grayfa;&lt;BR /&gt;pattern2 v=s c=graycc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;axis1 label=(a=90 "Percent of Subjects") order=(0 to 1.00 by .10) minor=none offset=(0,0);&lt;BR /&gt;axis2 label=none value=none offset=(3,3);&lt;BR /&gt;axis3 label=none split='\' offset=(3,3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title1 ls=1.5 "Frequency of Spectacle Wear";&lt;BR /&gt;title2 h=3.5 "Distance Vision, Bilateral Comparison";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;footnote1 height=10pct " ";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=my_data anno=anno_table;&lt;BR /&gt;format percent_of_subjects percentn7.0;&lt;BR /&gt;vbar bar_num / discrete&lt;BR /&gt; type=sum sumvar=percent_of_subjects nolegend&lt;BR /&gt; group=group_num subgroup=bar_num&lt;BR /&gt; raxis=axis1 maxis=axis2 gaxis=axis3&lt;BR /&gt; autoref clipref lref=1 cref=graydd&lt;BR /&gt; width=6 space=0 gspace=6&lt;BR /&gt; coutline=gray55&lt;BR /&gt; des='' name="&amp;amp;name";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;BR /&gt;ODS HTML CLOSE;&lt;BR /&gt;ODS LISTING;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Jun 2013 15:23:17 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2013-06-05T15:23:17Z</dc:date>
    <item>
      <title>Annotate SGPANEL or similar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91657#M3404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I create a similar chart in 9.2 TS2M3 to the one attached? The construction of the annotations below the graph itself are problematic.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11457iB1C9DDEBE749751A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="2084_001.jpg" title="2084_001.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 17:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91657#M3404</guid>
      <dc:creator>Doug</dc:creator>
      <dc:date>2013-05-31T17:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate SGPANEL or similar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91658#M3405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would start off by looking at Rob Allisons graph page and seeing if you can find an example.&lt;/P&gt;&lt;P&gt;It's definitely doable, but you can help out by providing what your sample data looks like as well, because that's an important factor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Survival Kaplan Meier graphs for example have this option by semi-default.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd17/quad.htm" title="http://robslink.com/SAS/democd17/quad.htm"&gt;SAS/Graph: Return -vs- Risk Plot&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 17:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91658#M3405</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-31T17:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate SGPANEL or similar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91659#M3406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample data set contains two products - test and control, the categories shown on the bottom of the sample, and percentages of each denominated against the product totals.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 18:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91659#M3406</guid>
      <dc:creator>Doug</dc:creator>
      <dc:date>2013-05-31T18:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate SGPANEL or similar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91660#M3407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I'm trying to do is attach the data table to the bottom of the panel chart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 21:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91660#M3407</guid>
      <dc:creator>Doug</dc:creator>
      <dc:date>2013-05-31T21:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate SGPANEL or similar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91661#M3408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't really have any examples like this, with a grouped bar chart (the annotate coordinates for a&amp;nbsp; grouped bar chart are a little tricker than for regular bar charts or gplots), therefore I wrote one to produce this specific chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let name=grouped_bar_table;&lt;BR /&gt;filename odsout '.';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt; value bartxt&lt;BR /&gt; 1 = 'None\of the time'&lt;BR /&gt; 2 = 'Some\of the time'&lt;BR /&gt; 3 = 'Half\of the time'&lt;BR /&gt; 4 = 'Most\of the time'&lt;BR /&gt; 5 = 'All\of the time'&lt;BR /&gt; ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data my_data;&lt;BR /&gt;format group_num bartxt.;&lt;BR /&gt;input group_num bar_num percent_of_subjects;&lt;BR /&gt;datalines;&lt;BR /&gt;1 1 .94&lt;BR /&gt;1 2 .96&lt;BR /&gt;2 1 .04&lt;BR /&gt;2 2 .02&lt;BR /&gt;3 1 .00&lt;BR /&gt;3 2 .00&lt;BR /&gt;4 1 .00&lt;BR /&gt;4 2 .01&lt;BR /&gt;5 1 .02&lt;BR /&gt;5 2 .01&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* determine how many groups, to determine geometry of table */&lt;BR /&gt;proc sql;&lt;BR /&gt;select count(unique(group_num)) into :groups from my_data;&lt;BR /&gt;quit; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_table_lines;&lt;BR /&gt;length function color $8 text $50;&lt;BR /&gt;xsys='1'; hsys='3'; when='a'; color='black';&lt;BR /&gt;/* draw the table lines going up/down */&lt;BR /&gt;do x=0 to 100 by (100/&amp;amp;groups);&lt;BR /&gt; ysys='1'; y=0; function='move'; output;&lt;BR /&gt; ysys='3'; y=2; function='draw'; size=.001; output;&lt;BR /&gt; end;&lt;BR /&gt;/* draw the table lines going across */&lt;BR /&gt;ysys='3';&lt;BR /&gt;x=0; y=14; function='move'; output;&lt;BR /&gt;x=100; function='draw'; output;&lt;BR /&gt;x=0; y=8; function='move'; output;&lt;BR /&gt;x=100; function='draw'; output;&lt;BR /&gt;x=0; y=2; function='move'; output;&lt;BR /&gt;x=100; function='draw'; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_table_numbers; set my_data;&lt;BR /&gt;length function color $8 text $50;&lt;BR /&gt;function='label'; position='5'; color='black';&lt;BR /&gt;xsys='1'; x=group_num*(100/&amp;amp;groups)-(100/&amp;amp;groups/2);&lt;BR /&gt;ysys='3';&lt;BR /&gt;if bar_num=1 then do;&lt;BR /&gt; y=11; text=put(percent_of_subjects,percentn7.0); output;&lt;BR /&gt; end;&lt;BR /&gt;if bar_num=2 then do;&lt;BR /&gt; y=5; text=put(percent_of_subjects,percentn7.0); output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anno_table; set anno_table_lines anno_table_numbers;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions device=png;&lt;BR /&gt;goptions noborder;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS LISTING CLOSE;&lt;BR /&gt;ODS HTML path=odsout body="&amp;amp;name..htm"&lt;BR /&gt; (title="Frequence of Spectacle Wear") style=sasweb;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions gunit=pct htitle=3.5 ftitle="albany amt/bold" htext=2.7 ftext="albany amt/bold";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pattern1 v=s c=grayfa;&lt;BR /&gt;pattern2 v=s c=graycc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;axis1 label=(a=90 "Percent of Subjects") order=(0 to 1.00 by .10) minor=none offset=(0,0);&lt;BR /&gt;axis2 label=none value=none offset=(3,3);&lt;BR /&gt;axis3 label=none split='\' offset=(3,3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title1 ls=1.5 "Frequency of Spectacle Wear";&lt;BR /&gt;title2 h=3.5 "Distance Vision, Bilateral Comparison";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;footnote1 height=10pct " ";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=my_data anno=anno_table;&lt;BR /&gt;format percent_of_subjects percentn7.0;&lt;BR /&gt;vbar bar_num / discrete&lt;BR /&gt; type=sum sumvar=percent_of_subjects nolegend&lt;BR /&gt; group=group_num subgroup=bar_num&lt;BR /&gt; raxis=axis1 maxis=axis2 gaxis=axis3&lt;BR /&gt; autoref clipref lref=1 cref=graydd&lt;BR /&gt; width=6 space=0 gspace=6&lt;BR /&gt; coutline=gray55&lt;BR /&gt; des='' name="&amp;amp;name";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;BR /&gt;ODS HTML CLOSE;&lt;BR /&gt;ODS LISTING;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 15:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91661#M3408</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-06-05T15:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate SGPANEL or similar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91662#M3409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the chart that the above code produces...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="grouped_bar_table.png" class="jive-image-thumbnail jive-image" height="410" src="https://communities.sas.com/legacyfs/online/3652_grouped_bar_table.png" width="553" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 15:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Annotate-SGPANEL-or-similar/m-p/91662#M3409</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-06-05T15:24:39Z</dc:date>
    </item>
  </channel>
</rss>

