%let name=nces_daisy; filename odsout '.'; /* SAS/Graph verison of graph on p. 29 of http://nces.ed.gov/nationsreportcard/pdf/dst2011/2012455.pdf */ data my_data; input value city $4-80; datalines; 63 Nation 59 Large city 52 Albuquerque 59 Atlanta 67 Austin 60 Baltimore City 60 Boston 64 Charlotte 60 Chicago 47 Cleveland 52 Dallas 54 Detroit 55 District of Columbia (DCPS) 44 Fresno 69 Hillsborough County (FL) 49 Houston 67 Jefferson County (KY) 54 Los Angeles 58 Miami-Dade 49 Milwaukee 61 New York City 56 Philadelphia 64 San Diego ; run; data my_data; set my_data; bar_order=_n_; if city in ('Nation' 'Large city') then colorval=1; else colorval=2; run; /* User-defined format so that bar_order prints as the city name. */ data control; set my_data (rename=(bar_order=start city=label)); fmtname='barfmt'; type='N'; run; proc format lib=work cntlin=control; run; data anno_values; set my_data; xsys='2'; ysys='2'; when='a'; hsys='3'; x=value+1; midpoint=bar_order; function='label'; position='6'; style='albany amt/bold'; text=trim(left(value)); run; /* Various other annotated stuff, that aren't tied to each bar... */ data anno_stuff; length text $100; xsys='1'; ysys='2'; when='a'; hsys='3'; function='label'; x=-1.0; /* a little to the left of the axis */ midpoint=2; /* 'Large city' is 2nd bar from the top */ position='2'; /* center it higher than the rest of the text */ size=1.3; /* make the size smaller */ text='1'; /* the super-scripted value is '1' */ xsys='3'; ysys='3'; position='6'; size=1.8; midpoint=.; x=65; y=20; text='Large city includes students from all cities in the nation with'; output; y=y-2.5; text='populations of 250,000 or more including the participating'; output; y=y-2.5; text='districts.'; output; y=y-3.5; text='NOTE: DCPS = District of Columbia Public Schools.'; output; x=65-.4; y=20; position='b'; /* center it higher than the rest of the text */ size=1.3; /* make the size smaller */ text='1'; /* the super-scripted value is '1' */ output; /* Since the des= alt text option is limited to 256 characters, I create 'invisible' annotated boxes around areas of the graph, and put my own text there... */ length html $1500; html='title='||quote( "Image of horizontal bar graphs. The X axis shows a range of percentages from 0 to 100. "|| "The Y axis lists the jurisdictions."||'0d'x|| "Nation 63."||'0d'x|| "Large city 59."||'0d'x|| "Albuquerque 52."||'0d'x|| "Atlanta 59."||'0d'x|| "Austin 67."||'0d'x|| "Baltimore City 60."||'0d'x|| "Boston 60."||'0d'x|| "Charlotte 64."||'0d'x|| "Chicago 60."||'0d'x|| "Cleveland 47."||'0d'x|| "Dallas 52."||'0d'x|| "Detroit 54."||'0d'x|| "District of Columbia (DCPS) 55."||'0d'x|| "Fresno 44."||'0d'x|| "Hillsborough County (FL) 69."||'0d'x|| "Houston 49." ||'0d'x|| "Jefferson County (KY) 67."||'0d'x|| "Los Angeles 54."||'0d'x|| "Miami-Dade 58."||'0d'x|| "Milwaukee 49."||'0d'x|| "New York City 61."||'0d'x|| "Philadelphia 56."||'0d'x|| "San Diego 64."||'0d'x|| "End of data list.")|| ' href="nces_daisy.htm"' ; function='move'; xsys='3'; ysys='3'; x=0; y=0; output; function='box'; xsys='1'; ysys='1'; x=100; y=100; color='white'; when='b'; style='empty'; output; output; /* 'footnote' info in right 1/3 of page */ html='title='||quote( "Footnotes:"||'0d'x|| "Large city includes students from all cities in the nation with populations of "|| "250,000 or more including the participating districts."||'0d'x|| "DCPS = District of Columbia Public Schools.")|| ' href="nces_daisy.htm"' ; function='move'; xsys='1'; ysys='3'; x=100; y=0; output; function='box'; xsys='3'; ysys='1'; x=100; y=100; color='white'; when='b'; style='empty'; output; output; /* 'title' info at top of page */ html='title='||quote( "Title:"||'0d'x|| "Percentage of answers rated as Acceptable for fourth-grade public school students, by jurisdiction: 2011.")|| ' href="nces_daisy.htm"' ; function='move'; xsys='3'; ysys='1'; x=0; y=100; output; function='box'; xsys='3'; ysys='3'; x=100; y=100; color='white'; when='b'; style='empty'; output; output; run; goptions device=png xpixels=900 ypixels=600; goptions border; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="NCES data") style=htmlblue; goptions gunit=pct ftitle="albany amt/bold" ftext="albany amt" htitle=3.0 htext=2.0; goptions ctext=gray33; pattern1 v=s c=cxef4d22; pattern2 v=s c=cx004784; axis1 label=none; axis2 label=('Percent') minor=none; title1 h=3.0 j=l font="albany amt/bold" c=cxf14c22 ls=1.5 ' Percentage of answers rated as "Acceptable" for fourth-grade public school students,'; title2 h=3.0 j=l font="albany amt/bold" c=cxf14c22 ls=0.6 ' by jurisdiction: 2011'; title3 a=-90 h=50pct " "; title4 a=90 h=1pct " "; proc gchart data=my_data anno=anno_stuff; format bar_order barfmt.; hbar bar_order / discrete type=sum sumvar=value subgroup=colorval anno=anno_values maxis=axis1 raxis=axis2 nostats noframe nolegend autoref cref=graydd clipref space=0 coutline=white des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;