BookmarkSubscribeRSS Feed

In a simple stacked bar chart, such as on a graph like such: proc sgplot data=sashelp.prdsale; vbar year/response=actual group=quarter groupdisplay=stack; run; It is often desired to have the response value labeled on each stacked bar.  This can be done with annotation, but it is cumbersome and causes difficulty when using SGPANEL (for example) to combine multiple charts.  Currently, datalabels create tables on top or bottom when used with stacked bar charts, but do not overlay the groups.  Instead doing this: proc sgplot data=sashelp.prdsale; vbar year/response=actual group=quarter groupdisplay=stack datalabel datalabelpos=center; run; or something like that would be simple, and as the data tip already contains this information, this should not be complex to implement.

12 Comments
pchegoor
Pyrite | Level 9

Hi   @Jay54 ,

 

How   does  one  produce  the  same Horizontal  Subgrouped Graph posted by  Rob  above  with  SGPLOT?

I am using  SAS 9.4M3.

 

 

Thanks,

Prashant

ChrisHemedinger
Community Manager
Status changed to: Suggestion Implemented

Marking as Delivered in SAS 9.4 Maintenance 2.

 

Examples are in this blog post: Getting Started with SGPLOT - VBAR -- and in this Sample 55866: Use the SEGLABEL option to label bar segments in a bar chart