BookmarkSubscribeRSS Feed
Roxie
Calcite | Level 5

New to this community and the software. I need to make a pie chart, which software system will work best.  

Clinic Admissions by Department

Department

Admissions

Surgery

5,426

OB

2,356

Peds

3,346

Ortho

2,100

Podiatry

575

Pain

1,587

Sports Med

2,634

Eye

1,535

Total

19,559

4 REPLIES 4
Reeza
Super User

@Roxie wrote:

New to this community and the software. I need to make a pie chart, which software system will work best.  



I'm assuming since you're on the SAS forum, you want the software system of SAS?

Or are you genuinely asking which language to use to create a pie chart. Or asking if you should use SAS Studio, EG, or something else entirely?

 

Since a pie chart is a graphic, I'll move this to the graphics forum. 

 

Assuming the question is "how to create a pie chart using SAS" here's the answer to that question:

Unfortunately, I think Pie charts are still covered under SAS/Graph and you can see several examples of the graphs and code required here:

http://robslink.com/SAS/democd7/aaaindex.htm

 

You can click the links to see the graphic and the code.

 


@Roxie wrote:

New to this community and the software. I need to make a pie chart, which software system will work best.  

Clinic Admissions by Department

Department

Admissions

Surgery

5,426

OB

2,356

Peds

3,346

Ortho

2,100

Podiatry

575

Pain

1,587

Sports Med

2,634

Eye

1,535

Total

19,559


 

 

sdengland
SAS Employee

In addition to the SAS/GRAPH GCHART procedure, you can also use the ODS Graphics Graph Template Language to create a pie chart. Using Robert's data:

 

proc template;
   define statgraph mypiechart;
      begingraph;
         entrytitle "My Pie Chart";
         layout region;
            piechart category=department response=admissions / dataskin=gloss;
         endlayout;
      endgraph;
   end;
run;

ods graphics on / reset imagename="mypiechart";
proc sgrender data=my_data template=mypiechart;
run;

 

 

 

mypiechart.png

 

For more information, see PIECHART Statement in SAS® 9.4 Graph Template Language: Reference, Fifth Edition.

GraphGuy
Meteorite | Level 14

data my_data;
input admissions department $ 6-50;
datalines;
5426 Surgery
2356 OB
3346 Peds
2100 Ortho
575 Podiatry
1587 Pain
2634 Sports Med
1535 Eye
;
run;

 

pattern1 v=s color=cx82CFFD repeat=8;

 

title1 ls=1.5 "My Pie Chart";


proc gchart data=my_data;
format admissions comma8.0;
pie department / type=sum sumvar=admissions descending
value=inside slice=outside coutline=gray55 noheader;
run;

 

pie.png

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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