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

Smurf_0-1723579607351.png

 

The legend text are not what I defined in Format. Does any one know why? The Diabetes_cat variable only has 1, 2, 3, but the legend has 1.2 and 1.8

proc format library=data;
	value Diabetes_cat
		1='Normal'
		2='Prediabetic'
		3='Diabetic'
	;
run;

legend2 label=('Diabetes')
;

proc gchart data=data.freq4chart2;
	donut Diabetes_cat / sumvar=count
		PERCENT=INSIDE
		subgroup=AgeGroup2
		donutpct=20 
	noheading
		legend=legend2;
run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LeliaM
SAS Employee

Add the DISCRETE option to the DONUT statement and let me know if you get the expected results

 

View solution in original post

3 REPLIES 3
Smurf
Obsidian | Level 7
proc format lib=data;
value site
1=Sydney
2=Atlanta
3=Paris
;
run;

data totals;
	length dept $ 7 ;
	input dept site quarter sales;
	format site site.;
datalines;
Parts 1 1 7043.97
Parts 2 1 8225.26
Parts 3 1 5543.97
Tools 1 4 1775.74
Tools 2 4 3424.19
Tools 3 4 6914.25
;


legend1 ;

proc gchart data=totals;
	format sales dollar8.;
	donut site / sumvar=sales
subgroup=dept 
donutpct=30
label=("All" justify=center "Quarters")
noheading
legend=legend1;
run;

Another Example already rebuilt such result.

LeliaM
SAS Employee

Add the DISCRETE option to the DONUT statement and let me know if you get the expected results

 

Smurf
Obsidian | Level 7
Yes, it gave the expected result.
Thank you so much!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 935 views
  • 0 likes
  • 2 in conversation