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 2024

Innovate_SAS_Blue.png

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
  • 1 reply
  • 560 views
  • 0 likes
  • 2 in conversation