BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jay54
Meteorite | Level 14

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;

BarLine_TopLabels.png

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.

milts
Pyrite | Level 9

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. Smiley Happy

Milton

GraphGuy
Meteorite | Level 14

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.

sas-innovate-2024.png

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.

 

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
  • 17 replies
  • 2601 views
  • 0 likes
  • 4 in conversation