%let name=trust; filename odsout '.'; /* SAS/Graph Imitation of ... http://blogs.forrester.com/charleneli/2008/04/data-chart-of-1.html */ data mydata; input value textline $ 5-80; datalines; .83 Opinion of a friend or acquaintance\who has used the product or service .75 A review of the product or service in\a newspaper, in a magazine, or on TV .69 Information on the\manufacturer's Web site .63 A review by a known expert .60 Consumer reviews on a retailer's site .52 Consumer reviews by\users of a content site .50 Information at online\consumer opinion sites .49 An online review by the\editors of a content site .37 Information in online chat\rooms or discussion boards .30 An online review by a blogger ; run; data mydata; set mydata; bar_order=_n_; run; data myanno; set mydata; length text $50; xsys='1'; ysys='2'; hsys='3'; when='a'; x=99; y=bar_order; function='label'; position='4'; text=put(value,percent5.0); run; data mydata; set mydata; length myhtmlvar $400; myhtmlvar= 'title='||quote( trim(left(textline))||'0d'x|| '----------------'||'0d'x|| trim(left(put(value,percent5.0)))||' trust.')|| ' href='||quote("trust_info.htm"); /* output an obsn for the left segment, and the right segment, of each bar */ color_segment=1; output; color_segment=2; value=1-value; output; run; proc sql noprint; create table control as select unique bar_order as start, textline as label from mydata; quit; run; data control; set control; fmtname='bar_fmt'; type='N'; run; proc format lib=work cntlin=control; run; goptions device=png; goptions xpixels=725 ypixels=600; goptions cback=white; goptions border; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Trusting sources of Information") style=htmlblue; goptions gunit=pct ftitle="albany amt/bold" ftext="albany amt" htitle=5 htext=2.25; goptions ctext=gray33; axis1 style=0 value=(j=right) split='\' label=none; axis2 style=0 major=none minor=none value=none label=none; pattern1 v=solid c=gray55; pattern2 v=solid c=graycc; title1 j=c f="albany amt/bold" h=5.00 ls=1.5 "A Matter of Trust"; title2 j=l f="albany amt/bold" move=(+2,+0) h=2.75 ls=1.5 "How much online North American consumers trust sources"; title3 j=l f="albany amt/bold" move=(+2,+0) h=2.75 "of information about products or services"; footnote1 j=l move=(+2,+0) f="albany amt" h=2.4 "Figures include respondents who answered 4 or 5 on a scale of 1 (do not trust) to 5 (trust completely)."; footnote2 j=l move=(+2,+0) f="albany amt" h=2.4 "Base: Online North American consumers."; footnote3 j=l move=(+2,+0) f="albany amt" h=2.4 ls=1.5 "Source: Forresters NACTAS Q3 2006 Media & Marketing Online Survey"; proc gchart data=mydata anno=myanno; format bar_order bar_fmt.; hbar bar_order / discrete type=sum sumvar=value descending nostats subgroup=color_segment nolegend maxis=axis1 raxis=axis2 coutline=same noframe html=myhtmlvar des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;