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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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