BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mmea
Quartz | Level 8

Hi I have this sgplot 

1. how can I color the bars in the color steel

2. why does my refline not show 🙂

 

proc sgplot data = plot;
   vbarparm category = x response = y / datalabel datalabelattrs = (size = 10)barwidth=.9;
   yaxis min = 0 max = 1;
   format x date9. y percent.;
   xaxis display = (nolabel);
   yaxis display = (nolabel) MAX=1;
   refline 80/lineattrs=(thickness=1 color=black) label=("text");
   Title1 font = 'Calibri' height=16pt "text";
run;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

You would use the FILLATTRS option on the Vbarparm to set a specific color such as
/ fillattrs=(color=steel)

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

2) Because you attempt to draw the line at y = 80, but restrict the Y axis to 1. 

 

You want the REFLINE at Y = 0.8

 

data plot;
   x = today();
   y = .9;
run;

proc sgplot data = plot;
   vbarparm category = x response = y / datalabel datalabelattrs = (size = 10) barwidth=.9;
   yaxis min = 0 max = 1;
   format x date9. y percent.;
   xaxis display = (nolabel);
   yaxis display = (nolabel) MAX=1;
   refline 0.80 / lineattrs=(thickness=1 color=black) label=("text");
   Title1 font = 'Calibri' height=16pt "text";
run;
ballardw
Super User

You would use the FILLATTRS option on the Vbarparm to set a specific color such as
/ fillattrs=(color=steel)

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

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1117 views
  • 1 like
  • 3 in conversation