BookmarkSubscribeRSS Feed
ErikT
Obsidian | Level 7

The STAR-chart in PROC GCHART does not draw lines from the origin to the points on the enclosing circle. I did not find an option to include such lines. Therefore I am trying to draw these radial lines with Annotate. However, so far I was not able to pick up the location of the origin (center) nor the radius of the enclosing circle. Any suggestion how to do that?

10 REPLIES 10
art297
Opal | Level 21

Are you just looking for how to include the lines (e.g., the noconnect option) or combining the two?  If it is the former, take a look at: http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#gr13n15-ex.htm

ErikT
Obsidian | Level 7

No, that is not what I want.

Below is the first picture of that article. I added the lines that I want in RED. The run from the center to each of the midpoint markers on the enclosing circle. In addition to the lines I also want to add tickmarks to the lines, but I suppose that when I am able to create the lines adding the tickmarks is not a major problem.

radials.jpg

ballardw
Super User

You may want to investigate GRADAR as it does the spokes and allows ticks on them. There are differences in how groups are displayed but without data examples it's hard to tell if that'll work.

ErikT
Obsidian | Level 7

That would be an option in some situations, but the challenge remains: how do I get the right co-ordinates for the various points in a STAR-chart. Although drawin radial lines is probably not very relevant to PIE-charts, the general problem how to position annotate elements in PIE- and START-charts remain.

art297
Opal | Level 21

Erik,

proc gchart and annotate are definitely not amongst my specialties, thus you may want to simply disregard what I have to say regarding your problem.  I came awfully close to producing what you want, but in a rather odd and incomplete way.  However, as you haven't received an answer yet, I figure I may at least share the method .. as forceful and incomplete as it is.  Hopefully, minimally, you might be able to use it to help discover what you are missing.

data meetings;

  informat date mmddyy10.;

  format date mmddyy10.;

  input (Dept Room) ($) Room_Number Date Hours;

  cards;

ACCOUNTS    C339      339     01/10/1995     1.00

ACCOUNTS    B100      100     01/24/1995     0.50

SHIP        C339      339     01/30/1995     2.00

MARKET      C301      301     02/24/1995     3.50

SHIP        C339      339     02/28/1995     4.00

MARKET      C301      301     03/01/1995     4.00

ACCOUNTS    B100      100     03/03/1995     3.50

ACCOUNTS    B100      100     03/08/1995     0.50

ACCOUNTS    B100      100     03/21/1995     0.25

SHIP        C301      301     03/27/1995     1.50

ACCOUNTS    C301      301     03/29/1995     0.50

SHIP        C339      339     04/12/1995     0.50

MARKET      C301      301     04/25/1995     1.50

MARKET      B100      100     05/02/1995     0.50

SHIP        C301      301     05/12/1995     2.50

MARKET      C301      301     05/25/1995     3.50

SHIP        C301      301     06/01/1995     2.00

SHIP        C339      339     06/07/1995     3.00

SHIP        C301      301     06/14/1995     2.00

MARKET      C339      339     07/12/1995     0.50

ACCOUNTS    B100      100     08/03/1995     3.00

SHIP        C301      301     08/14/1995     2.50

SHIP        C339      339     08/28/1995     1.50

MARKET      C339      339     09/15/1995     3.00

ACCOUNTS    C301      301     09/28/1995     0.50

MARKET      C301      301     10/11/1995     3.00

SHIP        C301      301     11/01/1995     1.50

MARKET      C339      339     11/15/1995     1.00

SHIP        B100      100     11/21/1995     2.00

SHIP        C339      339     11/22/1995     3.50

MARKET      C339      339     12/05/1995     2.50

MARKET      C301      301     12/21/1995     2.50

;

proc summary data=meetings;

  var hours;

  class room;

  output out=props n=;

run;

data props;

  set props;

  retain total;

  if _n_ eq 1 then total=hours;

  else do;

    prop=total/hours;

    output;

  end;

run;

proc sql;

  create table meetings2 as

    select a.*,b.prop

      from meetings as a,

           props as b

        having a.room eq b.room

  ;

quit;

goptions nodisplay htext=13pt htitle=15pt;

/* SLICE STAR CHART */

pattern1 color=graydd; pattern2 color=VLIB; 

pattern3 color=PALG;

title1 "Lengths of Meetings by Room";

proc gchart data=meetings2;

star room / noheading name="starA"

sumvar=hours fill=s coutline=black woutline=1;

run; quit;

/* SPINE STAR CHART */

proc gchart data=meetings2;

  star room / noheading name="starB"

  sumvar=prop fill=x noconnect

/*  percent=none value=none*/

  ctext=white

  coutline=red woutline=1;

run; quit;

filename chrt34 'c:\art\chrt34.emf';

goptions display gsfname=chrt34 gsfmode=replace;

proc greplay nofs igout=work.gseg tc=tempCat;

tdef T1X1

1/llx=0 ulx=0 urx=100 lrx=100

   lly=0 uly=100 ury=100 lry=0;

   template=T1X1;

treplay 1:StarA 1:StarB;

run; quit;

ErikT
Obsidian | Level 7

Art,

I see what you do. And yes this may work, provided that you keep the graphics environment equal, in order to keep the size and position of the two charts that you are stacking identical. But what about adding other elements to a PIE or START chart. I assume there must be some method in the Annotate facility to find the right co-ordinates of the center and the radius of the enclosing circle?!

art297
Opal | Level 21

Erik,  I will have to leave your question for someone who is more familiar with SAS/graph and annotate than I am.  I produced my pseudo solution to your problem this morning, but didn't post it as I was hoping that some "real" graph experts my provide the "real" answer.

Unfortunately, you may have to wait until after the holidays, which is why I decided to share my feeble attempt.

ErikT
Obsidian | Level 7

Art,

Much appreciated!

It can wait for some time.  There are several other topics I can work on.

Best wishes for 2012 to you and any other reader of this.

ErikT
Obsidian | Level 7

Has anybody a suggestion?

MikeZdeb
Rhodochrosite | Level 12

hi ... the big problem with using annotate to modify a star chart is that the data coordinate system cannot be used, so you'd have to figure out the locations of anything that has to be tweaked based on percentages of output area and that'll vary from chart to chart

so, Art's overlay solution is a lot easier than annotate (but pretty limited as to what you can accomplish)

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 10 replies
  • 1611 views
  • 0 likes
  • 4 in conversation