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!

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
  • 247 views
  • 0 likes
  • 2 in conversation