Is there a way to change the yaxis labeling instead of a numerical range (in this case 0-1) into showing a text label (see picture below. I manually pasted the output I wanted on top of the yaxis as an example. Aka, remove number value and replace with text equivalent)?
I'm trying to create an overlaid vbar chart that tracks the progress of corrective actions. I'm taking 2 date cuts to see what progression toward closure has been made. I assigned each progression "state" a numerical value (completeness). However, through searching here and on the web, I haven't found a good way to graph it. I can't assign a format to a numerical response (needed for vbar and vbarparm).
***Example Data set and output
Data A1;
input ID X1_Pct X2_Pct;
datalines;
1 0.1 0.1
2 0.95 1.0
3 0.75 0.5
4 0.1 0.25
5 0.5 0.5
6 0.5 0.75
;
run;
proc format;
value A1_fmt
0.1 = "Opened"
0.25 = "Investigation"
0.5 = "Stage 3"
0.75 = "Stage 4"
0.95 = "Pending Review"
1.00 = "Closed";
run;
Proc sgplot data=A1;
Title "Action Item: C1 C2 Overlay";
styleattrs datacolors=(Gray BIOY);
vbar ID / response=X2_PCT;
vbar ID / response=X1_PCT barwidth=.4 transparency=.5 nooutline ;
xaxis fitpolicy=rotatethin;
run;
I swear the answer is probably so simple, but I'm not sure how to properly phrase the question on the internet to get the right answer.
Thanks,
Wes
Is this what you want?
Proc sgplot data=A1; Title "Action Item: C1 C2 Overlay"; styleattrs datacolors=(Gray BIOY); vbar ID / response=X2_PCT; vbar ID / response=X1_PCT barwidth=.4 transparency=.5 nooutline ; xaxis fitpolicy=rotatethin; yaxis values=(0.1 0.25 0.5 0.75 0.95 1.0) valuesformat=A1_fmt.; run;
You didn't provide anything that would change the default tick mark generation of equal spaced ticks and nothing to apply the format.
Note that using actual character values gets you into a some more complex approaches to managing your data and getting the order on the axis correct and character values have NO natural spacing interval. They would have the same spacing between ticks pretty much regardless what you try.
@uopsouthpaw wrote:
Is there a way to change the yaxis labeling instead of a numerical range (in this case 0-1) into showing a text label (see picture below. I manually pasted the output I wanted on top of the yaxis as an example. Aka, remove number value and replace with text equivalent)?
I'm trying to create an overlaid vbar chart that tracks the progress of corrective actions. I'm taking 2 date cuts to see what progression toward closure has been made. I assigned each progression "state" a numerical value (completeness). However, through searching here and on the web, I haven't found a good way to graph it. I can't assign a format to a numerical response (needed for vbar and vbarparm).
***Example Data set and output
Data A1;
input ID X1_Pct X2_Pct;
datalines;
1 0.1 0.1
2 0.95 1.0
3 0.75 0.5
4 0.1 0.25
5 0.5 0.5
6 0.5 0.75
;
run;proc format;
value A1_fmt
0.1 = "Opened"
0.25 = "Investigation"
0.5 = "Stage 3"
0.75 = "Stage 4"
0.95 = "Pending Review"
1.00 = "Closed";
run;
Proc sgplot data=A1;
Title "Action Item: C1 C2 Overlay";
styleattrs datacolors=(Gray BIOY);
vbar ID / response=X2_PCT;
vbar ID / response=X1_PCT barwidth=.4 transparency=.5 nooutline ;
xaxis fitpolicy=rotatethin;
run;
I swear the answer is probably so simple, but I'm not sure how to properly phrase the question on the internet to get the right answer.
Thanks,
Wes
That is perfect. I knew it was just a slight alteration to the axis but couldn't for the life of me find the right set of commands.
Thank you so much.
Wes
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!
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.
Ready to level-up your skills? Choose your own adventure.