BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Abishekaa
Obsidian | Level 7

Hi all, Appreciate your advice on this. I want to display my percentages rounded to a whole number. Is there a possibility to do that in the proc spgpie step.Below is my code:

proc sgpie data=ab noautolegend
 	dattrmap=attrmap;
 	pie var1 / 
 	datalabelloc=inside datalabeldisplay=(response percent ) datalabelattrs=(size=25 family='Calibri' weight=bold)
startangle=90 attrid=myid ;
by ID;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

The only way to do this currently is to NOT show the pie percentage label, but instead send the percentages to the pie via the RESPONSE column and use the STATFMT option to set a PERCENT format with no decimal places.

 

Hope this helps!

Dan

View solution in original post

4 REPLIES 4
sbxkoenk
SAS Super FREQ

Moved your post to Graphics Programming board !

 

Is this post of any help to you?

holevalue of sgpie format
https://communities.sas.com/t5/SAS-Enterprise-Guide/holevalue-of-sgpie-format/m-p/770252#M39597

 

Koen

 

DanH_sas
SAS Super FREQ

The only way to do this currently is to NOT show the pie percentage label, but instead send the percentages to the pie via the RESPONSE column and use the STATFMT option to set a PERCENT format with no decimal places.

 

Hope this helps!

Dan

Abishekaa
Obsidian | Level 7

Thank you, Dan! Does this mean we have to calculate the percentages in a prior step before the pie chart?

DanH_sas
SAS Super FREQ

Yes, you would need to precompute each slice as a percent of total to use this approach.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

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. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 533 views
  • 4 likes
  • 3 in conversation