Data visualization with SAS programming

PIE3D: Exploding slices

Accepted Solution Solved
Reply
Contributor
Posts: 33
Accepted Solution

PIE3D: Exploding slices

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

Attachment

Accepted Solutions
Solution
‎01-04-2012 03:45 PM
SAS Employee
Posts: 967

PIE3D: Exploding slices

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


All Replies
SAS Employee
Posts: 967

PIE3D: Exploding slices

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

Contributor
Posts: 33

PIE3D: Exploding slices

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

Solution
‎01-04-2012 03:45 PM
SAS Employee
Posts: 967

PIE3D: Exploding slices

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;

Contributor
Posts: 33

PIE3D: Exploding slices

Thanks a lot Robert, it works Smiley Wink

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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