%let name=spanish; filename odsout '.'; /* Imitation of bar chart on page 9 of the following doc: http://usuarios.lycos.es/cursonavarra2/documentos/MODULO3/DIA1/DOCUMENTOS/Estadistica_Basica_ParteI.pdf */ /* You can use the following tool on a windows pc to generate the special characters, and then cut-n-paste them ... Start->Programs->Accessories->System Tools->Character Map. */ /* I'm using the locale, to get the specail nlnumeric formatting for the response axis. */ options LOCALE=Spanish_Spain; data work.a; format accidents nlnum15.0; label accidents='Número de AT'; input city $ 1-30 year accidents; length myhtml $200; myhtml='title='|| quote( 'City: '||trim(left(city))||'0D'x|| 'Year: '||trim(left(year))||'0D'x|| 'Accidents: '||trim(left(put(accidents,nlnum15.0)))||' ' ) || ' href='||"http://www.bcn.es/english/ihome.htm"||' ' ; cards; CATALUÑA 2000 182000 CATALUÑA 2001 142000 ANDALUCIA 2000 139000 ANDALUCIA 2001 110000 MADRID 2000 120500 MADRID 2001 99900 COMUNIDAD VALENCIANA 2000 119200 COMUNIDAD VALENCIANA 2001 86500 PAIS VASCO 2000 50000 PAIS VASCO 2001 39800 ; /* Annotate the diagonal gray line behind the bar chart */ data work.anno; length function color $8 text $30; retain xsys ysys '1' when 'b'; color='gray'; function='move'; x=100; y=0; output; function='draw'; x=0; y=100; output; run; goptions device=png; goptions hsize=7in vsize=5in; goptions border; /* something to make pre-v9.3 spacing like v9.3 spacing */ goptions hpos=114 vpos=50; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="SAS/Graph Spanish example") style=minimal gtitle nogfootnote; goptions gunit=pct ftitle="arial/bo" ftext="arial" htitle=4.5 htext=2.75; /* I wrote this sas job on unix. To get the special characters into the titles, I entered the Alt+numeric in an outlook email editor, and then cut-n-pasted the special character into my unix vi editor session in an xterm (via Hummingbird Exceed). Here are the codes: o with accent = Alt+162 a with accent = Alt+160 u with accent = Alt+163 n with tilde = Alt+164 N with tilde = Alt+165 */ title1 f="arial/bo" h=3.5 "Accidentes de Trabajo por Comunidad Autónoma, en las cinco que"; title2 f="arial/bo" h=3.5 "tienen frecuencia más alta en número absoluto. España, años 2000 y"; title3 f="arial/bo" h=3.5 "2001 (Enero-Septiembre). Datos Fuente: INHST"; /* The original graph I was copying had '2002' in the title, but 2001 in the legend of the graph. I assumed that the legend of the graph was generated from the actual data, and therefore that the legend was the correct one (and the 2002 in the title was incorrect), and changed my version of the graph accordingly. */ /* Footnote with a url link to the graph I'm imitating */ /* footnote link="http://usuarios.lycos.es/cursonavarra2/documentos/MODULO3/DIA1/DOCUMENTOS/Estadistica_Basica_ParteI.pdf" "SAS Imitation of the following plot [click here, look on page 9]"; */ /* Midpoint axis */ axis1 label=none value=none; /* Response axis */ axis2 minor=none order=(0 to 200000 by 20000) label=(a=90) offset=(0,0); /* Group axis */ axis3 label=none value=(h=2.25 f="arial/bo") offset=(3,3) order=("CATALUÑA" "ANDALUCIA" "MADRID" "COMUNIDAD VALENCIANA" "PAIS VASCO"); /* Use the desired colors */ pattern1 c=CXffff9b; pattern2 c=cyan; /* Did a little customizing to add the (ENE-SEP) to the 2001 legend tickmark value */ legend1 mode=protect position=(top right inside) across=1 label=none shape=bar(2,2) offset=(-5,-8) value=(j=l tick=2 '2001 (ENE-SEP)' ) ; /* I needed some more 'color' on my demo page, so I'm coloring the background (the original had white background). */ goptions cback=tan; proc gchart data=a anno=anno; vbar year / discrete group=city subgroup=year sumvar=accidents maxis=axis1 raxis=axis2 gaxis=axis3 noframe space=0 /* width=8 */ gspace=9 coutline=black legend=legend1 autoref cref=graydd clipref html=myhtml des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;