BookmarkSubscribeRSS Feed
deleted_user
Not applicable
How can I display the bar statistic value at the end of the bar?

I've tried the BARCHART statement's BARLABEL option, but it generates an error when running PROC TEMPLATE.

Thanks,
Randy

proc template;
define statgraph b_test;
begingraph / border=false ;
layout overlay / xaxisopts=(display=none) yaxisopts=(display=none) WALLDISPLAY=NONE ;
barchart x=value / name="legend" orient=vertical display=standard barlabel=true barwidth=1
fillattrs=(color=RED) OUTLINEATTRS=(color=black);
endlayout;
endgraph;
end;
run;
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Care to share the exact SAS error message you receive?

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
With BARLABEL option:

proc template;
387 define statgraph b_test;
388 begingraph / border=false ;
389 layout overlay / xaxisopts=(display=none) yaxisopts=(display=none) WALLDISPLAY=NONE ;
390 barchart x=value / name="legend" orient=vertical display=standard barlabel=true barwidth=1
--------
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, BARWIDTH, CONNECTATTRS,
DATASELECTABLE, DATATRANSPARENCY, DISPLAY, FILLATTRS, GROUP, GROUPORDER, INDEX,
LEGENDLABEL, NAME, ORIENT, OUTLINEATTRS, PRIMARY, STAT, TIP, TIPFORMAT, TIPLABEL,
URL, XAXIS, YAXIS.
ERROR 76-322: Syntax error, statement will be ignored.
391 fillattrs=(color=RED) OUTLINEATTRS=(color=black);
392 endlayout;
393 endgraph;
394 end;
WARNING: Object will not be saved.
395 run;
NOTE: PROCEDURE TEMPLATE used (Total process time):
real time 0.07 seconds
cpu time 0.03 seconds

Without BARLABEL option:

proc template;
397 define statgraph b_test;
398 begingraph / border=false ;
399 layout overlay / xaxisopts=(display=none) yaxisopts=(display=none) WALLDISPLAY=NONE ;
400 barchart x=value / name="legend" orient=vertical display=standard barwidth=1
401 fillattrs=(color=RED) OUTLINEATTRS=(color=black);
402 endlayout;
403 endgraph;
404 end;
NOTE: STATGRAPH 'B_test' has been saved to: SASUSER.TEMPLAT
405 run;
NOTE: PROCEDURE TEMPLATE used (Total process time):
real time 0.18 seconds
cpu time 0.00 seconds
Cynthia_sas
SAS Super FREQ
Hi:
The documentation implies that BARLABEL=TRUE should work:
http://support.sas.com/documentation/cdl/en/grstatgraph/61949/HTML/default/barchart_sect4.htm#grstat...

If you find that it doesn't work, you might wish to work with SAS Tech Support to find an answer.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1647 views
  • 0 likes
  • 3 in conversation