Hello Community, I recently started learning SAS, completed my certification, But never exposed to the Graphs before. I got little familar with SGPLOT/ SGPANEL. I am looking to learn proc template. I googled alot and looked on the SAS website I did not got much luck. My professor said, try this website. I am new here , forgive for my mistakes. My questions is How to display the counts inside the Graph? How to display '0' when there is no count? My case make 'custom' is zero count. I have the following Graph, I want to display the counts Inside the graph for each make. I see on SAS website to use the Inner margin and axistable options When I tried I am getting Errors. Can you please help how I can achieve this using Proc template. I am not sure how this website work. if I posted in wrong place please forgive me and guide me to right place. Thank you. Reference Code for inner margin :https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/p0v5nj3waz75w4n1s2y70echq6im.htm#p08pr1slkds374n14ysbxx1lr3uq data cars;
set sashelp.cars;
where origin = 'USA' and make in ('Saturn' 'Jeep' 'Mercury');
output;
run;
data xx;
make = 'custom';
origin = 'USA';
Run;
data cars1;
set cars xx;
run;
proc freq data = cars;
table make/out = freq;
run;
proc template;
define statgraph boxplot;
begingraph;
entrytitle "City Mileage for Vehicle Types";
layout overlay /
xaxisopts=(offsetmin=0.1 offsetmax=0.1);
boxplot y=mpg_city x=make /
datalabel=make spread=true;
/* Wrong in my code what to enter?*/
innermargin / align=bottom opaque=true backgroundcolor=cxf5f5f5;
axistable x= @@@ value=@@@ /
stat=Sum display=(label)
headerlabel="Counts"
headerlabelattrs=GraphLabelText
valueattrs=(size=9pt weight=bold)
;
endinnermargin;
endlayout;
endgraph;
end;
run;
proc sgrender data=cars1 template=boxplot;
label type="Vehicle Type";
run;
... View more