With SAS 9.3 (maybe this is a hint for future usage), you can get the label "exactly" on top of the value using DATALABELPOSITION option. Unfortunately, we did not add this option to proc SGPLOT, but is availabel in GTL. You can use this option to create your graph using Rick's data as follows:
proc template; define statgraph barline; begingraph; layout overlay; barchart x=xvar y=Vbar_Y; seriesplot x=xvar y=Plot_Y / display=(markers) datalabel=Plot_Y datalabelposition=top
datalabelattrs=(size=9) markerattrs=(symbol=circlefilled size=9); endlayout; endgraph; end; run; proc sgrender data=a template=barline; format plot_y 2.0;format xvar monname3.;
format Vbar_Y dollar6.;
run;
Note the format applied to the plot_y variable in the SGRENDER procedure. To center the label it is important to strip all leading blanks. Label and marker sizes are increased in this code.
Hi Rick,
Thank you very much for this info. But I believe this type of graph is not yet available in 913? I'm currently developing for a client who only has 913. Hope they upgrade to the latest version.
Milton
Also, you might be tempted to try to use "proc gbarline" and specify the 'pointlabel' option on the symbol statement, but that's not supported as of SAS 9.3 -- there is a request in for this feature to be added (S0175859), but no specific eta yet.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: