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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.