Hi. When I run the following code...
data pie1;
do i=1 to 1000;
v=5;
output;
end;
v=10;
output;
v=15;
output;
v=20;
output;
run;
ods listing gpath='/home/xxx/AHAGM/images';
ods graphics / imagename="pie1" imagefmt=png;
title "pie1";
proc sgpie data=pie1;
pie v / otherpercent=0;
run;
I get this result. My understanding is that using "otherpercent=0" should cause all slices to appear and be labelled.
I think you need to specify the label with OTHERLABEL
data pie1;
do i=1 to 1000;
v=5;
output;
end;
v=10;
output;
v=15;
output;
v=20;
output;
run;
*ods listing gpath='/home/xxx/AHAGM/images';
*ods graphics / imagename="pie1" imagefmt=png;
*title "pie1";
proc sgpie data=pie1;
pie v / otherpercent=1 otherlabel='Other';
run;
No, what I'm trying to get is a slice for every value of v...so it should be count 1000 for 5, and count 1 for 10, 15, and 20. Instead, I'm only getting a count of 1 for 20.
You could try GTL. It looks like GTL have better control.
data pie1; do i=1 to 1000; v=5; output; end; v=10; output; v=15; output; v=20; output; run; proc template; define statgraph simplepie; begingraph; entrytitle "Car Models by Origin"; layout region; piechart category=v / datalabellocation=outside OTHERSLICE=FALSE LABELFITPOLICY=NONE OUTLINEATTRS=(thickness=0); endlayout; endgraph; end; run; proc sgrender data=pie1 template=simplepie; run;
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →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.
Ready to level-up your skills? Choose your own adventure.