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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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