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



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 2 replies
  • 1295 views
  • 0 likes
  • 2 in conversation