BookmarkSubscribeRSS Feed
PaigeW
Calcite | Level 5

I'm using PROC GCHART - PIE3D and have problems with data values between 1 and 0.  No matter how I try to affect the formating, the slice comes out as 0% or .81.  I've tried OTHER=# to group such values into "Other" or Proc Format picture with (round fuzz=#) to round up and label accordingly.  Neither is working, so clearly there something wrong in how I'm trying to do this.

Here are the relevant code snippets:

/* first, tried the following, adding OTHER=# in PROC GCHART */

PROC FORMAT;

  PICTURE pctfmt (ROUND FUZZ=.5)

RUN;

/* didn't round up, so tried the following - after commenting out the OTHER=# option */

PROC FORMAT;

   PICTURE pctfmt (ROUND)

   0-<1 = "(<1%)"(noedit)

   1-<9.9 = "09.0%)" (prefix="(")

   10-<99.9 = "099.0%)" (prefix="(")

   99.9-100 = "(>99%)" (noedit);

/* with the following */

PROC GCHART DATA = PWSAS.DATA_TEST2;

     PIE3D Dog_Breed / type = freq

     SUMVAR = percent

     NOLEGEND

     ANGLE = 90

     OTHER = 1

     SLICE = arrow

     MIDPOINT = 'Pug' 'French Bull Dog' 'Boxer' 'Mastiff' ... 'Other';

     VALUE = outside

     NOHEADING;

format percent pctfmt.;

Title "Breed Groups in the area:;

RUN;

QUIT;

I get one slice that is either 0% or .81.  Do not ever get an "other" slice or the breed label with a value = "<1%".

What have I overlooked or forgotten?  It seems that something inside PROC GCHART is over-riding the formatting I wish to use.

thanks, Paige

3 REPLIES 3
GraphGuy
Meteorite | Level 14

Could you post up the data values you're using?

PaigeW
Calcite | Level 5

Hello,

     I apologize for being so slow to respond ... when things get fired up around here, it's not until the drive home do I remember.

     The data ranges can be anywhere from 0.00 to 100.00 although 0 and 100 are almost never seen.  The range I'm working with is, roughly, 1.6 to 55.8 and one pesky value of 0.81.  I cannot get it to round up, attach to the (0<1) in the PROC Format Picture code, which I'm not sure I'm using correctly since none of the other values pay attention to it either.

     I recently discovered we are missing a "hot fix" (?) or something that includes rounding.  We are going to be moving to 9.3 ...........soon.  Any day now.  If that doesn't correct the problem, which I'm optimistically sure it will, I'll have to figure out how to make something else work.  The problem is temporarily on the back-burner, however .... if anyone can advise on using the "other" option in PROC GCHART with a 3D Pie chart and/or correct use of PROC Format Picture, I would be very appreciative.

v/r

Paige

GraphGuy
Meteorite | Level 14

Could you provide some sample data that demonstrates the problem?

Are you sure you want to use type=freq (counting up how many obsns in each slice)?

If you could provide some sample data, and tell us what you want the graph to show ... we can probably come up with several ways to accomplish that 🙂

sas-innovate-2024.png

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.

 

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.

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
  • 3 replies
  • 863 views
  • 0 likes
  • 2 in conversation