Data visualization with SAS programming

ODS graphics gtl : grid on top of barchart

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 127
Accepted Solution

ODS graphics gtl : grid on top of barchart

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;


Accepted Solutions
Solution
‎06-09-2013 06:36 AM
SAS Super FREQ
Posts: 1,136

Re: ODS graphics gtl : grid on top of barchart

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.

View solution in original post


All Replies
Super User
Posts: 11,105

Re: ODS graphics gtl : grid on top of barchart

You might want to try using the REFERENCELINE statement.

Solution
‎06-09-2013 06:36 AM
SAS Super FREQ
Posts: 1,136

Re: ODS graphics gtl : grid on top of barchart

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.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 389 views
  • 3 likes
  • 3 in conversation