libname herc 's:\courses\stat-renaes\Stat404'; * Vertical bar chart with frequency count; goptions reset=all; proc gchart data=herc.staff; vbar Job_Title; where Job_Title =:'Sales Rep'; title 'Number of Employees by Job Title'; run; quit; * 3-D Vertical bar chart with frequency count; goptions reset=all; proc gchart data=herc.staff; vbar3D Job_Title; where Job_Title =:'Sales Rep'; title 'Number of Employees by Job Title'; run; quit; * Three-dimensional Horizontal Bar Chart; goptions reset=all; proc gchart data=herc.staff; hbar3d Job_Title; title 'Number of Employees by Job Title'; where Job_Title =:'Sales Rep'; run; quit; * Suppress the Display of Statistics on Horizontal Bar Charts ; goptions reset=all; proc gchart data=herc.staff; hbar3d Job_Title / nostats; title 'Number of Employees by Job Title'; where Job_Title =:'Sales Rep'; run; quit; * Creating Bar Charts Based on Statistics ; goptions reset=all; proc gchart data=herc.staff; vbar Job_Title / sumvar=salary type=mean; where Job_Title =:'Sales Rep'; format salary dollar9.; label Job_Title='Job Title' Salary='Salary'; title 'Average Salary by Job Title'; run; quit; * Assigning a Different Color to Each Bar ; goptions reset=all; proc gchart data=herc.staff; vbar Job_Title / sumvar=salary type=mean patternid=midpoint mean; where Job_Title =:'Sales Rep'; format salary dollar9.; title 'Average Salary by Job Title'; run; quit; * Dividing Bars into Subgroups ; goptions reset=all; proc gchart data=herc.staff; vbar Job_Title/subgroup=Gender; where Job_Title =:'Sales Rep'; title 'Frequency of Job Title, Broken Down by Gender'; run; quit; * Grouping Bars ; goptions reset=all; proc gchart data=herc.staff; vbar gender/group=Job_Title patternid=midpoint; where Job_Title =:'Sales Rep'; title 'Frequency of Job Gender, Grouped by Job Title'; run; quit;