BookmarkSubscribeRSS Feed
tburus
Obsidian | Level 7

I am trying to create a template that will fill slices of a pie using PROC Template and PIECHART. I know I can use DISCRETEATTRMAP, but the problem is I am using this template on automated pie creations with the OTHERSLICE= option enabled, so I don't necessarily know which attributes (or how many) will show up in any given run. I tried using FILLATTRS=(COLOR=()), but this seemed to only allow for one color. Is it possible to define my own color rotation to be used in this manner?

 

My code:

proc template;
define statgraph top5pie;
begingraph;
layout region;
	piechart category = injsite /
	datalabellocation = inside
	datalabelcontent =(percent)
	datalabelattrs = (family='Arial/bold' weight=bold size=12pt color=&Dgold.)
	categorydirection = clockwise
	dataskin = crisp
	start = 180 name = 'pie'
	otherslice=true
  	othersliceopts=(type=percent percent=10 label="Others (Sites < 10% of Total)");
	discretelegend 'pie' /
	title = 'Injury Sites'
	titleattrs=(family='Arial' size=12pt)
	border=false;
endlayout;
endgraph;
end;
run;

 

1 REPLY 1
Ksharp
Super User
Plz post it at ODS Graphics Forum . and can you switch it into PROC SGPIE ?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 363 views
  • 0 likes
  • 2 in conversation