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.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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