BookmarkSubscribeRSS Feed
Calcite | Level 5



I am using the STAR command in GCHART to plot my data, which all works fine.


The default is to label the spines on the plot with the variable (call it X) used to create the spine.


I would like the chart to show a different label than X (call it Y).  Is that possible in GCHART?


For example, I would like the splines to correspond the the variable X which has the values "a" "b" "c" "d", but label the

spline with a very different variable Y which takes on different values.


Any help would be appreciated.


Thank you in advance.




Super User

If it's one to one mapping from X to Y, a format may be one way to do it easily. 

Meteorite | Level 14

Here's some code to 'flesh out' what Reeza suggested.


Basically if you have a numeric variable X that you want to use to control the order of the radar chart spokes, but you have a character variable Y that you want to use to label the spokes (rather than using the X-values), you can create a user-defined format so that the x values will print as the y-text.



data foo;
length y $1;
input x y line value;
1 A 1 5
2 B 1 7
3 C 1 2
4 D 1 1
5 E 1 4
1 A 2 4
2 B 2 6
3 C 2 3
4 D 2 2
5 E 2 5


proc sql;
create table temp as
select unique x as start, y as label
from foo;
quit; run;
data control; set temp;
fmtname = 'xfmt';
type = 'N';
end = START;
proc format lib=work cntlin=control;


title1 "Radar Chart";
proc gradar data=foo;
chart x / overlay=line freq=value;

proc gradar data=foo;
format x xfmt.;
chart x / overlay=line freq=value;


The first graph is the radar chart with the spokes labeled with the numeric X, and in the 2nd chart the spokes are labeled with the Y text (via the user-defined format):








Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1 like
  • 3 in conversation