Hi,
I can't find the option to have the gridlines over my bars,
not under but on top of them.
I use sgrender with gtl like this :
* style template;
proc template;
define style styles.alertlevels;
parent=wivisp_sasstyle;
style GraphColors from GraphColors /
'gdata1' = CXD6E1F1
'gdata2' = CXDEBEAD
'gdata3' = CXE59C69
'gdata4' = CXED7925
;
class graphgridlines / contrastcolor=colors('wivisp3') color=red ;
end;
run;
* graph template;
proc template;
title;footnote;
define statgraph ALbarchart;
dynamic latin source;
begingraph / border=false;
entrytitle "Early warning index";
entrytitle latin;
entryfootnote "© WIV-ISP – Data Source:" source;
layout overlay /
yaxisopts=(label='Cases / week'
griddisplay=on
display=(label tickvalues))
xaxisopts=(label='week'
griddisplay=off
display=(label tickvalues ticks));
barchart x=Date y=Cases /
group=AlertLevel
index=index
barwidth=.8
name='zut'
outlineattrs=(thickness=0 color=white)
datatransparency=0
legendlabel='Alert Level'
grouporder=ascending;
discretelegend 'zut'/
border=false
title='Alert Level';
endlayout;
endgraph;
end;
run;
There is no option in GTL to place grid lines on top of the plots. Grids always go behind the plots.
But, you have two other ways to do this. You can make the bar chart a bit transparent. Or, instead of turning on gridlines, draw reference lines at each major tick value on the appropriate axis. You can use LINEATTRS=GRAPHGRIDS to get the same visual properties.
You might want to try using the REFERENCELINE statement.
There is no option in GTL to place grid lines on top of the plots. Grids always go behind the plots.
But, you have two other ways to do this. You can make the bar chart a bit transparent. Or, instead of turning on gridlines, draw reference lines at each major tick value on the appropriate axis. You can use LINEATTRS=GRAPHGRIDS to get the same visual properties.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.