I am not experienced with pie chart. I had a problem to create my desired pie chart.
here is my data:
data temp;
input Role $ Rate;
datalines;
LPN 0.27
RN 0.64
. 0.09
;
run;
after I run following procedure, I got a pie chart without any label for the missing value for variable Role.
proc gchart data=temp;
pie Role /sumvar=rate
other=0
midpoints='' 'LPN' 'RN'
percent=arrow
slice=arrow
noheading;
run;
quit;
However, I like the slice for the missing value labeled as 'Missing'. Anyone can help me with this? I will appreciate it very much.
Thanks Robert.
Obviously that works. But I don't want change the dataset by replacing missing character value with some other characters such as 'Missing' as you suggested.
I believe there must be some other way to go.
In that case, you could use a user-defined format, so the ' ' value prints as the word 'Missing' ...
data temp;
input Role $ Rate;
datalines;
LPN 0.27
RN 0.64
. 0.09
;
run;
proc format;
value $piefmt
' ' = "Missing"
;
run;
proc gchart data=temp;
format Role $piefmt.;
pie Role /sumvar=rate
other=0
midpoints='Missing' 'LPN' 'RN'
percent=arrow
slice=arrow
noheading;
run;
proc print data=temp;
format Role $piefmt.;
run;
Thanks Robert. This is definitely a better way to achieve it, I like it.
By the way, there are not any other graph options to handle this case? I believe there should be some.
Anyway, thanks again, you give me a professional solution. 🙂
An axis statement would allow *much* finer control of the tickmark values ... but the axis statement can only be used with bar charts (not pie charts).
Perhaps this is a sneaky/subtle way to nudge users towards using bar charts instead of pie charts! 😉