Type : CREATION_INTERNE
El conjunto de datos `my_data` se crea directamente en el script usando un paso DATA y una instrucción DATALINES, proporcionando datos para las categorías A y B con sus respectivas cantidades.
| 1 | %let name=bar1; |
| 1 | filename odsout '.'; |
| 1 | DATA my_data; |
| 2 | INPUT CATEGORY SERIES $ 3-11 AMOUNT; |
| 3 | DATALINES; |
| 4 | 1 Series A 5 |
| 5 | 2 Series A 7.8 |
| 6 | 1 Series B 9.5 |
| 7 | 2 Series B 5.9 |
| 8 | ; |
| 9 | RUN; |
| 1 | ODS LISTING CLOSE; |
| 2 | ODS HTML path=odsout body="&name..htm" |
| 3 | (title="SGplot Horizontal Grouped Bar") |
| 4 | style=htmlblue; |
| 5 | |
| 6 | ods graphics / imagefmt=png imagename="&name" |
| 7 | width=800px height=600px noborder imagemap; |
| 1 | title1 color=gray33 ls=0.5 h=23pt "Horizontal Grouped Bar"; |
| 2 | title2 color=gray33 ls=0.5 h=17pt "Compares values across categories"; |
| 3 | |
| 4 | PROC SGPLOT DATA=my_data noautolegend; |
| 5 | styleattrs datacolors=(cx9999ff cx993366); |
| 6 | hbar category / response=amount stat=sum |
| 7 | group=series groupdisplay=cluster grouporder=descending |
| 8 | outlineattrs=(color=black) nostatlabel; |
| 9 | xaxis |
| 10 | values=(0 to 10 BY 2) |
| 11 | labelattrs=(size=16pt weight=bold color=gray33) |
| 12 | valueattrs=(size=16pt weight=bold color=gray33) |
| 13 | offsetmax=0 grid minor minorcount=1; |
| 14 | yaxis |
| 15 | labelattrs=(size=16pt weight=bold color=gray33) |
| 16 | valueattrs=(size=16pt weight=bold color=gray33) |
| 17 | display=(noticks); |
| 18 | RUN; |
| 19 | |
| 20 | QUIT; |
| 1 | ODS HTML CLOSE; |
| 2 | ODS LISTING; |