%let name=radar; filename odsout '.'; /* options fontrendering=HOST_PIXELS; options nogstyle; */ data mydata; input Dealership $ 1-20 measure $ 22-43 value; datalines; Hendrick Dodge Loan to Value 80 Hendrick Dodge Loan Amount 25000 Hendrick Dodge Chargeoff Pct 4 Hendrick Dodge Chargeoff Amt 1000 Performance Chevy Loan to Value 70 Performance Chevy Loan Amount 15000 Performance Chevy Chargeoff Pct 5 Performance Chevy Chargeoff Amt 500 CrossRoads Ford Loan to Value 60 CrossRoads Ford Loan Amount 20000 CrossRoads Ford Chargeoff Pct 6 CrossRoads Ford Chargeoff Amt 750 ; run; /* Here are some macro variables that will be used for 'normalizing' the data values, so they can be plotted in the same 0->1 axis. */ %let maxltv=100; /* Loan to Value */ %let maxloan=50000; /* Loan Amount */ %let maxcopct=10; /* Chargeoff Pct */ %let maxcoamt=2000; /* Chargeoff Amt */ /* Calculated the 'normalized' values */ data mydata; set mydata; format nvalue comma5.1; if measure eq 'Loan to Value' then nvalue=(value/&maxltv); if measure eq 'Loan Amount' then nvalue=(value/&maxloan); if measure eq 'Chargeoff Pct' then nvalue=(value/&maxcopct); if measure eq 'Chargeoff Amt' then nvalue=(value/&maxcoamt); run; /* Create custom annotated text labels for each axis */ data anno_label; length function color cbox $8 text $10; retain xsys ysys '2' when 'a'; function='label'; size=1.5; color='black'; xc='Loan to Value'; y=0; text='0%'; position='a'; output; xc='Loan Amount'; y=0; text='$0'; position='c'; output; xc='Chargeoff Pct'; y=0; text='0%'; position='c'; output; xc='Chargeoff Amt'; y=0; text='$0'; position='c'; output; xc='Loan to Value'; y=1; text=trim(left(&maxltv))||'%'; position='d'; output; xc='Loan Amount'; y=1; text='$'||trim(left(&maxloan)); position='f'; output; xc='Chargeoff Pct'; y=1; text=trim(left(&maxcopct))||'%'; position='f'; output; xc='Chargeoff Amt'; y=1; text='$'||trim(left(&maxcoamt)); position='f'; output; run; /* Or, if you want the lightest color in the center */ data anno_colors; length function style color $10; retain xsys '3' ysys '3' when 'b' style 'solid'; orig_red= input('ad',hex2.); orig_green=input('dd',hex2.); orig_blue= input('8e',hex2.); function='move'; x=50; y=50; output; do i=0 to 100 by 2; count+1; function='pie'; rotate=360; size=50-(i/2); percent=(count-1)/(43); red=orig_red + ( (256-orig_red) * percent ); if red > 255 then red=255; green=orig_green + ( (256-orig_green) * percent ); if green > 255 then green=255; blue=orig_blue + ( (256-orig_blue) * percent ); if blue > 255 then blue=255; rgb=put(red,hex2.)||put(green,hex2.)||put(blue,hex2.); color="cx"||rgb; output; end; run; /* */ GOPTIONS DEVICE=png; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="SAS/Graph Radar Chart") style=minimal; goptions gunit=pct htitle=5 htext=3; goptions ftitle="arial" ftext="arial"; symbol i=join v=dot; axis1 label=('Chargeoff Amt') major=(number=4); axis2 label=('Chargeoff Pct') major=(number=4); axis3 label=('Loan Amount') major=(number=4); axis4 label=('Loan to Value') major=(number=4); /* axis1 label=('Chargeoff Amt') order=(0 to 1 by .2); axis2 label=('Chargeoff Pct') order=(0 to 1 by .2); axis3 label=('Loan Amount') order=(0 to 1 by .2); axis4 label=('Loan to Value') order=(0 to 1 by .2); */ title "Car Dealership Comparison"; title2 c=gray "This example uses contrived data"; legend1 cborder=black cblock=gray cframe=cornsilk; proc gradar data=mydata anno=anno_colors; chart measure / overlay=Dealership sumvar=value /* sumvar=nvalue */ cstars=(black red green) wstars=2 2 2 lstars=1 1 1 /* The way these numbers are handled has changed in v9.2 */ staroutradius=100 /* 100% of screen size for outer radius */ starinradius=30 /* 30% of screen size for inner radius */ noframe /* frame cframe=cornsilk */ spokescale=vertex /* aha! - this is an undocumented option that allows each of the axes to be scaled independently! */ starcircles=(1.0) /* staraxis=(axis1, axis2, axis3, axis4) starcircles=(0 .5 1.0) */ /* Bummer - radar doesn't support legend statement */ /* legend=legend1 */ des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;