Hi everybody,
This is my today's problem, I am creating a PIE3D that i want with all slices exploded, i wanted to display some of my text labels on two lines so I used the special caracter "0A"x to do it and it works.
But when I want to explode the slices with the "two lines" tex labels it dosn't work.
I have joined the sas data and this is my Gchart procedure :
ODS RTF FILE="d:\test\test3.doc" ;
GOPTION DEVICE=ACTXIMG VSIZE=25CM HSIZE=20CM ;
PROC GCHART DATA=freq ;
PIE3D ltypologie /sumvar=percent noheading discrete
explode="Acte d'AMP" "Autres" "Stimulation ovarienne" "Structure"
clockwise angle=120 RADIUS=40 other=0 ;
FORMAT percent pct_rd.;
RUN ; QUIT ;
GOPTION RESET=ALL ;
ODS RTF CLOSE ;
So the two slices who don't want to be exploded are :
Erreur d'attribution/identification and
Perte de gamètes/embryons
Thanks a lot for your help
One solution would be to assign simple numeric values for each pie slice, and then it's easy to "explode" those numeric slice names. Then create a user-defined format (data-driven) so that those numbers print as the desired text...
libname mydata '.';
ODS RTF FILE="pie.doc";
GOPTION DEVICE=ACTXIMG VSIZE=25CM HSIZE=20CM;
/* create numbers for each pie slice */
data tempdata; set mydata.freq;
slicenum=_n_;
run;
/* create user-defined format so those numbers show up as the desired text */
data control; set tempdata (rename = ( slicenum=start ltypologie=label));
fmtname = 'piefmt';
type = 'N';
end = START;
run;
proc format lib=work cntlin=control;
run;
PROC GCHART DATA=tempdata;
format slicenum piefmt.;
/* FORMAT percent pct_rd.; */
PIE3D slicenum /
sumvar=percent
noheading
discrete
explode=1 2 3 4 5 6
clockwise
angle=120
RADIUS=40
other=0;
RUN; QUIT;
ODS RTF CLOSE;
Do you specifically want to use device=actximg, and Proc Gchart?
not really Robert, I used actximg so I can use "0A"x in my text labels and display them in two lines on the graph
One solution would be to assign simple numeric values for each pie slice, and then it's easy to "explode" those numeric slice names. Then create a user-defined format (data-driven) so that those numbers print as the desired text...
libname mydata '.';
ODS RTF FILE="pie.doc";
GOPTION DEVICE=ACTXIMG VSIZE=25CM HSIZE=20CM;
/* create numbers for each pie slice */
data tempdata; set mydata.freq;
slicenum=_n_;
run;
/* create user-defined format so those numbers show up as the desired text */
data control; set tempdata (rename = ( slicenum=start ltypologie=label));
fmtname = 'piefmt';
type = 'N';
end = START;
run;
proc format lib=work cntlin=control;
run;
PROC GCHART DATA=tempdata;
format slicenum piefmt.;
/* FORMAT percent pct_rd.; */
PIE3D slicenum /
sumvar=percent
noheading
discrete
explode=1 2 3 4 5 6
clockwise
angle=120
RADIUS=40
other=0;
RUN; QUIT;
ODS RTF CLOSE;
Thanks a lot Robert, it works
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.