BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
NeilH
Obsidian | Level 7

Hello, is it possible to label the values of the vertices of a radar chart similar to how the bars of a bar chart can be labeled with their values? In this example, the values 68.1 and 79.7 would be labeled along the Program dimension (section variable). I understand it's not quite the same, but wanted to check if it was possible. Thanks.

data rc_temp5;
input var $ rating1 survey $ source $ section $;
cards;
f_pr_inst_mean  68.1 Faculty Institute Program
f_pr_national_mean 79.7 Faculty National Program
f_fa_inst_mean  78.6 Faculty Institute Faculty
f_fa_national_mean 86.3 Faculty National Faculty
f_in_inst_mean  76.0 Faculty Institute Institution
f_in_national_mean 67.3 Faculty National Institution
f_le_inst_mean  88.9 Faculty Institute Leadership
f_le_national_mean 76.8 Faculty National Leadership
f_ed_inst_mean  75.2   Faculty Institute Education
f_ed_national_mean 84.0 Faculty National Education
;
run;
proc gradar data=rc_temp5;
where survey = 'Faculty';
chart section / 
freq=rating1 
overlay=source
cstarfill=(CX7C95CA CXDE7E6F)
starfill=(empty empty)
cframe= beige
;
run;

NeilH_2-1722277791616.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarciaS
SAS Employee

Hi @NeilH,

 

If you change the FREQ=RATING1 to SUMVAR=RATING1 and add the SPOKESCALE=VERTEX option to the CHART statement in PROC GRADAR, each spoke will display 3 tick marks. The first is the minimum value and the third tick mark is the maximum value for that spoke. 

Below is a modification of your program with these changes and the sample output.

 

data rc_temp5;
length var $19 source $9 section $11;
input var $ rating1 survey $ source $ section $;
cards;
f_pr_inst_mean  68.1 Faculty Institute Program
f_pr_national_mean 79.7 Faculty National Program
f_fa_inst_mean  78.6 Faculty Institute Faculty
f_fa_national_mean 86.3 Faculty National Faculty
f_in_inst_mean  76.0 Faculty Institute Institution
f_in_national_mean 67.3 Faculty National Institution
f_le_inst_mean  88.9 Faculty Institute Leadership
f_le_national_mean 76.8 Faculty National Leadership
f_ed_inst_mean  75.2   Faculty Institute Education
f_ed_national_mean 84.0 Faculty National Education
;
run;
proc gradar data=rc_temp5;
where survey = 'Faculty';
chart section / 
sumvar=rating1 
overlay=source
cstarfill=(CX7C95CA CXDE7E6F)
starfill=(empty empty)
cframe= beige
spokescale=vertex
;
run;
quit;

MarciaS_0-1722282427861.png

 

View solution in original post

3 REPLIES 3
MarciaS
SAS Employee

Hi @NeilH,

 

If you change the FREQ=RATING1 to SUMVAR=RATING1 and add the SPOKESCALE=VERTEX option to the CHART statement in PROC GRADAR, each spoke will display 3 tick marks. The first is the minimum value and the third tick mark is the maximum value for that spoke. 

Below is a modification of your program with these changes and the sample output.

 

data rc_temp5;
length var $19 source $9 section $11;
input var $ rating1 survey $ source $ section $;
cards;
f_pr_inst_mean  68.1 Faculty Institute Program
f_pr_national_mean 79.7 Faculty National Program
f_fa_inst_mean  78.6 Faculty Institute Faculty
f_fa_national_mean 86.3 Faculty National Faculty
f_in_inst_mean  76.0 Faculty Institute Institution
f_in_national_mean 67.3 Faculty National Institution
f_le_inst_mean  88.9 Faculty Institute Leadership
f_le_national_mean 76.8 Faculty National Leadership
f_ed_inst_mean  75.2   Faculty Institute Education
f_ed_national_mean 84.0 Faculty National Education
;
run;
proc gradar data=rc_temp5;
where survey = 'Faculty';
chart section / 
sumvar=rating1 
overlay=source
cstarfill=(CX7C95CA CXDE7E6F)
starfill=(empty empty)
cframe= beige
spokescale=vertex
;
run;
quit;

MarciaS_0-1722282427861.png

 

NeilH
Obsidian | Level 7

Thank you!

ballardw
Super User

It is possible but can be tedious.

First you need a separate AXIS statement for each set of labels you want. Then you use the STARAXIS statement to use the axis statements in the desired order.

Key to remember the the default vertical axis that gets labeled is in position 1. So in your example counting clockwise from that the 'Program' axis is number 5 of 5.

 

Example Axis statements. Axis1 has the labels requested, Axis2 is basically the default ticks and such with no labels.

Then the staraxis = () uses one of the defined Axis statements for each of the 5 positions.

axis1 order=(68.1, 79.7) ;
axis2 value=none;

proc gradar data=rc_temp5;
   where survey = 'Faculty';
   chart section / 
   freq=rating1 
   overlay=source
   cstarfill=(CX7C95CA CXDE7E6F)
   starfill=(empty empty)
   cframe= beige
   staraxis= (axis2, axis2, axis2, axis2, axis1 )
;
run;

Caution: this approach can create different scales for each axis if just specifying one or two points in the ORDER list.

If you are thinking of multiple different labels you want to fix first and last values so the scales stay the same. For example.

axis1 order=(0, 68.1, 79.7,100) ;
axis2 order=(0 ,50, 100);
axis3 order=(0 ,78.6, 86.3,100);
axis4 order=(0 ,  67.3, 76.0,100);
axis5 order=(0 ,  76.8, 88.9,100);

proc gradar data=rc_temp5;
   where survey = 'Faculty';
   chart section / 
   freq=rating1 
   overlay=source
   cstarfill=(CX7C95CA CXDE7E6F)
   starfill=(empty empty)
   cframe= beige
   staraxis= (axis2, axis3, axis4, axis5, axis1 )
;
run;

Notice that values get rounded.

Getting past my vaguely remembered syntax for Gradar from SAS 6.

 

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
  • 3 replies
  • 98 views
  • 1 like
  • 3 in conversation