BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kmel56
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

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;

View solution in original post

4 REPLIES 4
GraphGuy
Meteorite | Level 14

Do you specifically want to use device=actximg, and Proc Gchart?

kmel56
Calcite | Level 5

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

GraphGuy
Meteorite | Level 14

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;

kmel56
Calcite | Level 5

Thanks a lot Robert, it works Smiley Wink

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2316 views
  • 0 likes
  • 2 in conversation