Im using the below code to create a stacked bar chart. I'm using axistable to present the n (count) for each stack , since there a is big list of the groups ( stack) , the plot is looking compressed and not at all readable , that is, the axistable occupies most of the graphic area. What is the best way to present the count of each stack and how to do that?Any suggestion?
Normally, you could use the SEGEMENTLABELTYPE to turn on the bar segment labels, but this will show the response values, which are the values in your "percent" variable. To show your "count" variable in the same location, your best option is to overlay a TEXTPLOT on the BARCHARTPARM to put the count values in the segments.
To do this, you will need to write a little data step to calculate the y positions for each value in a separate column that you will use for the Y column on the TEXTPLOT statement. The data step should accumulate the y positions for group value in a category, so be sure your data is sorted correctly before feed it into this data step.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.