BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8
In my HTML output I don't see the keylegend "bmi" (with title='Rate').
How do I fix this?
Thank you.

goptions device=png;
ods listing close;
ods html file='Band_Plots.html' path='C:\Documents and Settings\SASCode\Field_Office' style=styles.bmi;
ods graphics / reset width=900px height=700px imagename="Band_Plots" imagefmt=png;
title1 'Small';
proc sgplot data=mus;
band x=injury_cnt upper=upper_hours lower=lower_hours /
transparency=.5 group=category name="rate";
xaxis min=0 max=20 label='Injury' grid;
yaxis min=0 max=200000 label='Hours' grid;
keylegend "bmi" / position=bottom location=outside across=4 title='Rate: ';
series x=inj_u y=hour_u1 / datalabel=inj_yr lineattrs=(pattern=solid thickness=2px)
markerattrs=(symbol=circlefilled ) markers group=job_class name="pts";
keylegend "pts" / position=bottomleft location=outside across=1 title='Job:';
inset "Rate=Injury / Hours" " " /
position=bottomright textattrs=graphfootnotetext;
run;
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Where is your name="bmi" option??? The link between the KEYLEGEND and the plot statement is the fact that you use the name= name(s) on the plot statement and on the keylegend statement. A KEYLEGEND statement has to be "linked" in this manner.

cynthia

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 1 reply
  • 757 views
  • 0 likes
  • 2 in conversation