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)

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 962 views
  • 1 like
  • 3 in conversation