Not every aspect of the Graph Style attributes can be modified using the GTL syntax. As far as I can recall, wall outline attributes and axis line attributes cannot be changed using GTL syntax. When using only x-y axes, the top and right axis lines are really the wall outline. One way to change the apparent wall outline or axis line using GTL syntax, you can turn off these display using the syntax options, and then use a DRAWRECTANGLE statement to draw a full rectangle around the wall in WALLPERCENT drawspace.
In the code below, if we use W=100 (%), then we get a rectangle width spanning only the data extent from first bar midpoint to last bar midpoint. So, given we have 6 bars (or, 5 bar spacing), we need to use a W=120% to span the entire space. This still leaves a few pixels gap, so I used 122%. You could also use 102% for height (for upper gap), but then use y=51%.
proc template;
define statgraph xxbarchart;
*begingraph / border=off;
begingraph / border=on borderattrs=(color=red);
*layout overlay / walldisplay=(fill);
layout overlay / border=on borderattrs=(color=blue) walldisplay=none
xaxisopts=(display=(ticks tickvalues))
yaxisopts=(display=(ticks tickvalues));
barchart x=age / group=sex orient=vertical name='xx' displaybaseline=auto;
drawrectangle x=50 y=51 / width=122 height=102 drawspace=datapercent;
*discretelegend 'xx'/ border=off;
discretelegend 'xx'/ border=on borderattrs=(color=green);
endlayout;
endgraph;
end;
run;
ods graphics / width=15cm height=10cm;
proc sgrender data=sashelp.class template=xxbarchart;
run;
ods graphics off;
... View more