<?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: Fun With SAS ODS Graphics: A 100% Bar Chart Look at Intra and Inter-Conference NFL Standings in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-A-100-Bar-Chart-Look-at-Intra-and/m-p/954409#M25198</link>
    <description>&lt;P&gt;Go Bills!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PXL_20241213_235832504.jpg" style="width: 225px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103323i5E1CF5AB68F6A4D2/image-dimensions/225x300?v=v2" width="225" height="300" role="button" title="PXL_20241213_235832504.jpg" alt="PXL_20241213_235832504.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 21 Dec 2024 15:26:35 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2024-12-21T15:26:35Z</dc:date>
    <item>
      <title>Fun With SAS ODS Graphics: A 100% Bar Chart Look at Intra and Inter-Conference NFL Standings</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-A-100-Bar-Chart-Look-at-Intra-and/m-p/954307#M25197</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Within Divisions" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103273i007FD1FD6F19202B/image-size/large?v=v2&amp;amp;px=999" role="button" title="NflStandingsIntradivisional.png" alt="Within Divisions" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Within Divisions&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Across Divisions" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103275i7CFA5358D6486B4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="NflStandingsInterdivisional.png" alt="Across Divisions" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Across Divisions&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;With the regular NFL season wrapping up, are you ready for some SAS ODS Graphics football? A bit oversimplified on the rankings (left as an exercise for you &lt;/SPAN&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://www.nfl.com/standings/tie-breaking-procedures" target="_self"&gt;NFL tiebreaking procedures&lt;/A&gt;&lt;SPAN&gt; experts!) but here's a SAS ODS Graphics 100% Win-Loss-Tie Bar Chart take on the latest intra and inter-divisional &lt;/SPAN&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://www.nfl.com/standings/" target="_self"&gt;NFL Standings&lt;/A&gt;&lt;SPAN&gt; using SGPANEL and SGPLOT.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun With SAS ODS Graphics: A Bar Chart Look at Intra and Inter-Conference NFL Standings
  Data source: google.com/search?q=nfl+standings;
                                                                * Import data from Excel;
proc import datafile='/home/ted.conway/NFLstandings20241219.xlsx' dbms=xlsx 
            out=nflstats(rename=(c=TEAM d=W_CHAR e=L_CHAR f=T_CHAR)) replace;
getnames=no;
                                                                * Cleanup and eshape data for charting;
data nflstats2chart(keep=TEAM_CONF_DIV CONF_DIV TEAM pct wlt wlt_order games w l t);
set nflstats;
length CONF_DIV $ 25.; retain CONF_DIV;                         * Get conference/division from column A and retain it; 
if a=:'NFC' or a=:'AFC' then CONF_DIV=A;
if a=:'NFC' or a=:'AFC' or team in ('','Team') then delete;     * Only output rows with standings;
TEAM_CONF_DIV=catt(TEAM, ' (', CONF_DIV, ')');                  * Create composite column for ranking across conferences/divisions;
w=input(w_char,best.);                                          * Convert wins/losses/ties to numeric;
l=input(l_char,best.);
t=input(t_char,best.);
pct=w/(w+l+t);                                                  * Calc winning percentage for ranking;
wlt='W'; wlt_order=1; games=W; output;                          * Create 1 row for each type (wins/losses/ties);
wlt='L'; wlt_order=2; games=L; output; 
wlt='T'; wlt_order=3; games=T; output;

%SGANNO;                                                        * Create annotation dataset with NFL logo, location using SAS macros;         
data nflimg;                                                    * Source: en.wikipedia.org/wiki/File:National_Football_League_logo.svg;
%SGIMAGE (image="/home/ted.conway/National_Football_League_logo.svg.png",drawspace="GRAPHPERCENT",x1=94.4,y1=6,height=10,heightunit="PERCENT",anchor="bottomright");                                                            
                                                                * Rank teams by winning % within divisions;
proc sort data=nflstats2chart; by conf_div descending pct team wlt_order;
                                                                * SGPANEL bar chart of standings within conferences;
ods graphics / reset height=7in width=9in noborder imagefmt=svg;
proc sgpanel data=nflstats2chart noautolegend pad=(left=.2in right=.2in) pctlevel=group sganno=nflimg;
styleattrs datacolors=(green red lightgrey);                    * Colors for wins/losses/ties;
panelby CONF_DIV / headerbackcolor=white columns=1 layout=rowlattice uniscale=column onepanel noheaderborder noborder rowheaderpos=left novarname spacing=3;
hbar team / response=games group=WLT barwidth=1 stat=percent dataskin=crisp grouporder=data fill seglabel seglabelattrs=(color=white weight=bold);
colaxis values=(0 to 1 by .1) valuesformat=percent6. display=(nolabel noline) refticks=(values) offsetmin=.02;
rowaxis discreteorder=data display=(nolabel noticks noline) offsetmin=.15 offsetmax=.15 labelattrs=(weight=bold size=12pt); 
rowaxistable games / classorder=data position=left valueattrs=(size=8.5pt) pad=0;
refline (.1 to 1 by .1) / axis=x label="";     

%SGANNO;                                                        * Create annotation dataset with NFL logo, location using SAS macros; 
data nflimg;                                                    * Source: en.wikipedia.org/wiki/File:National_Football_League_logo.svg;
%SGIMAGE (image="/home/ted.conway/National_Football_League_logo.svg.png",drawspace="GRAPHPERCENT",x1=94.6,y1=7.6,height=10,heightunit="PERCENT",anchor="bottomright"); 
                                                                * Rank teams by winning % across divisions;
proc sort data=nflstats2chart; by descending pct team wlt_order;
                                                                * SGPLOT bar chart of standings across conferences;
proc sgplot data=nflstats2chart(drop=pct) noborder noautolegend pad=(left=.2in right=.2in) pctlevel=group sganno=nflimg;;
styleattrs datacolors=(green red lightgrey);                    * Colors for wins/losses/ties;
hbar TEAM_CONF_DIV / response=games dataskin=crisp stat=percent group=WLT barwidth=1 grouporder=data seglabel seglabelattrs=(color=white weight=bold);
xaxis values=(0 to 1 by .1) valuesformat=percent6. display=(nolabel noline) refticks=(values) offsetmin=.02;
yaxis discreteorder=data display=(noline noticks nolabel) labelattrs=(weight=bold size=11pt);      
refline (.1 to 1 by .1) / axis=x label="";
yaxistable games / classorder=data position=left location=inside valueattrs=(size=8.5pt);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample Input Data" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103276iA1380FC187894069/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NflStandingsData.png" alt="Sample Input Data" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sample Input Data&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 17:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-A-100-Bar-Chart-Look-at-Intra-and/m-p/954307#M25197</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2024-12-20T17:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics: A 100% Bar Chart Look at Intra and Inter-Conference NFL Standings</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-A-100-Bar-Chart-Look-at-Intra-and/m-p/954409#M25198</link>
      <description>&lt;P&gt;Go Bills!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PXL_20241213_235832504.jpg" style="width: 225px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103323i5E1CF5AB68F6A4D2/image-dimensions/225x300?v=v2" width="225" height="300" role="button" title="PXL_20241213_235832504.jpg" alt="PXL_20241213_235832504.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2024 15:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-A-100-Bar-Chart-Look-at-Intra-and/m-p/954409#M25198</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2024-12-21T15:26:35Z</dc:date>
    </item>
  </channel>
</rss>

