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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 721 views
  • 1 like
  • 3 in conversation