BookmarkSubscribeRSS Feed
Jaime
Fluorite | Level 6
I am using the below script to create a bullet chart. I am not asking for a legend but it's still gived me the legend.

ods graphics / reset width=250 height=130 ;
proc sgplot data=chart ;
hbar binner/ response=bin3 transparency=0.2 nooutline barwidth=1 fillattrs=(color=gray) ;
hbar binner/ response=actual transparency=0.2 nooutline barwidth=.3 fillattrs=(color=black) ;
refline .71 /lineattrs=(color=red Thickness=4px ) axis=x ;
yaxis display =none;
xaxis display=(nolabel);

run;
2 REPLIES 2
DanH_sas
SAS Super FREQ
Use the NOAUTOLEGEND option on the proc statement to turn off the legend.

Thanks!
Dan
Jaime
Fluorite | Level 6
Thanks. That worked.
Another question.
I an using databels to show the value of the measure variable.
By default the value appears at the end of the bar. Is there a way of making it appear in the bottom inside of the bar chart.


proc sgplot data=chart NOAUTOLEGEND ;
hbar binner/ response=bin3 transparency=0.2 nooutline barwidth=1 fillattrs=(color=cxD9D9D9) ;
hbar binner/ response=bin2 transparency=0.2 nooutline barwidth=1 fillattrs=(color=cxBDBDBD) ;
hbar binner/ response=bin1 transparency=0.2 nooutline barwidth=1 fillattrs=(color=cx636363) ;
hbar binner/ response=actual transparency=0.2 nooutline barwidth=.3 fillattrs=(color=black) datalabel=bottom;
refline .71 /lineattrs=(color=red Thickness=4px ) axis=x ;
yaxis display =none;
xaxis display=(nolabel);
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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