Ho do i get rid of white space within each cell that results from altering the variable used as datalabel (see attached pdf image).
E.g. in cell "-Overall-" I want to show the discrepancy in timeliness of first antibiotics administrations and subsequent administrations. The green line presents first administration and the dark green line subsequent administrations. The vertical bar chart is the distribtion for the first administration.
When I use labels that only contain "60.0%" and "44.1%", I don't have a problem with white space. But I want to help the reader and added " | 1st admin." and " |nth admin." using:
sum30cL=strip(strip(sum30c)!!" | 1st admin.");
sum30cOverallL=strip(strip(sum30cOverall)!!" | nth admin.");
sum30cL and sum30cOverallL have normal length, format and informat.
Anyone knows the reason of the sudden white space on the right side within each cell?
Code for plot:
ods listing;
ods graphics /
reset=index
imagename='Figure overall colour'
imagefmt=jpg
width=40cm
height=30cm
noborder;
ods listing gpath="&bron " image_dpi=400;
proc sgpanel data=fig1tot noautolegend;
panelby ABclass /
columns=2
rows=5
spacing=5
novarname
noborder
noheaderborder
skipemptycells
headerbackcolor="#2c7fb8"
headerattrs=(color=white size=8 weight=bold family=calibri)
sort=ascformat;
vline diffvstoedcat /response=sum30 lineattrs=(color="#b3de69" pattern=solid thickness=2)
datalabel=sum30cL datalabelpos=right datalabelattrs=(size=8 color=darkgrey family=calibri weight=bold);
vline diffvstoedcat /response=sum30Overall lineattrs=(color="darkgreen" pattern=solid thickness=2)
datalabel=sum30cOverallL datalabelpos=right datalabelattrs=(size=8 color=darkgrey family=calibri weight=bold);
vbar diffvstoedcat / response=_PERC_
baselineattrs=(thickness=0)
nozerobars
colorresponse=diffvstoedcat2 colormodel=("#b3de69" "#fb8072" "black")
nooutline fill
datalabel=_PERC_2 datalabelattrs=(size=6 color=darkgrey family=calibri) datalabelfitpolicy=rotate;
dropline x=0 y=30/ lineattrs=(pattern=36 thickness=1 color="#377eb8") dropto=x;
rowaxis display=(noline noticks) label="Percentage"
valueattrs=
(family=calibri
color=black
size=8
style=normal)
values=(0,10,20,30,40,50,60,70,75)
valuesdisplay=("0%" "10%" "20%" "30%" "40%" "50%" "60%" "70%" "")
labelattrs=
(family=calibri
color=black
size=8
style=normal
weight=bold);
colaxis display=(noticks) label="Minutes deviation from prescribed"
valueattrs=
(family=calibri
color=black
size=8
style=normal)
values=(-13 to 14 by 1)
valuesdisplay=(">-120min" "-110min to -119min" "-100min to -109min" "-90min to -99min" "-80min to -89min"
"-70min to -79min" "-60min to -69min" "-50min to -59min" "-40min to -49min" "-30 to -39min" "-20min to -29min"
"-10min to -19min" "0min to -9min" "0" "0min to 9min" "10min to 19min"
"20min to 29min" "30min to 39min" "40min to 49min"
"50min to 59min" "60min to 69min" "70min to 79min"
"80min to 89min" "90min to 99min" "100min to 109min"
"110min to 119min" ">120min" "Not administered")
labelattrs=
(family=calibri
color=black
size=8
style=normal
weight=bold);
colaxistable _FREQ_/
label
position=bottom
droponmissing
valueattrs= (family=calibri
size=5
style=normal)
labelattrs=
(family=calibri
color=black
size=8
style=normal);
label _FREQ_="n=";
run;
ods graphics off;
ods listing close;
The space is there to account for the possibility of the VLINE going to the end of the axis, with your label on the end of that line. However, since you know that will not happen in your case, use the OFFSETMAX option on the COLAXIS statement to manually adjust the axis offset to remove the space.
Hope this helps!
Dan
The space is there to account for the possibility of the VLINE going to the end of the axis, with your label on the end of that line. However, since you know that will not happen in your case, use the OFFSETMAX option on the COLAXIS statement to manually adjust the axis offset to remove the space.
Hope this helps!
Dan
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: