BookmarkSubscribeRSS Feed
vladem
Calcite | Level 5
I place header labels on bottom and want to rotate it. Is it possible?

Thank you,
Vladimir
6 REPLIES 6
GraphGuy
Meteorite | Level 14
We'll need more details ...

For example, what proc are you using?

And do you want to rotate the one axis label, or the values at each tickmark along the axis?
DanH_sas
SAS Super FREQ
Hey Vladimir,

I'm assuming you are running a PROC SGPANEL and used COLUMNHEADERPOS to move the labels to the bottom. If so, It is not currently possible to rotate them. Please post a code snipit so I'll precisely know your situation.

Thanks!
Dan
vladem
Calcite | Level 5
Actually, I use code from "Sample 39166: Distribution of eye irritation". I modernized it for testing and put header labels on bottom. I need to increase length of label but SAS truncated it, and I want to rotate labels.
Is it possible?

proc format;
value xvarf
1 = 'Week 1 Week 1 Week 1'
2 = 'Week 2'
3 = 'Week 4'
4 = 'Week 6'
5 = 'Week 8'
6 = 'End Point';
value groupf
1 = 'Placebo'
2 = 'Drug A'
3 = 'Drug B';
run;
%macro test;
proc template;
define statgraph EyeIrritation;
begingraph;
mvar %do j=1 %to 6; tck1&j tck2&j %end; ;
entrytitle halign=center 'Distribution of Eye Irritation (Redness)'{sup "1"}
/ textattrs=GraphTitleText(FAMILY="arial"
SIZE=12pt
WEIGHT=bold
COLOR=cx3f4896);
layout gridded / border=false;
layout datalattice columnvar=time / shrinkfonts=false
COLUMNHEADERS=bottom
HEADERBACKGROUNDCOLOR=GraphAltBlock:color
HEADEROPAQUE=FALSE
HEADERLABELDISPLAY=VALUE
HEADERLABELLOCATION=OUTSIDE
HEADERLABELATTRS=GRAPHVALUETEXT(SIZE=6pt
WEIGHT=normal
COLOR=black
FAMILY="arial")
cellwidthmin=50
border=false
columndatarange=union
columnaxisopts=(display=(line))
rowaxisopts=(offsetmin=0
linearopts=(viewmax=100 tickvaluepriority=true)
LABEL='Number of Patients, %'
LABELATTRS=GraphLabelText(SIZE=10pt
WEIGHT=bold
COLOR=cx3f4896
FAMILY="arial")
TICKVALUEATTRS=GraphValueText(SIZE=6pt
WEIGHT=bold
COLOR=black
FAMILY="arial")
griddisplay=off);
layout prototype / walldisplay=none;
barchart x=n y=percent / group=chartvar
name='a'
BARLABEL=TRUE
BARLABELFORMAT=pctfmt.
BARLABELATTRS=GraphDataText(SIZE=6pt
WEIGHT=bold
COLOR=black
FAMILY="arial")
skin=modern
outlineattrs=(color=black)
barwidth=1;
endlayout;

endlayout;
entry ' ';

discretelegend 'a' / LOCATION=OUTSIDE
HALIGN=CENTER
VALIGN=CENTER
BORDER=FALSE
TITLE=''
TITLEATTRS=GraphValueText(SIZE=8pt
WEIGHT=bold
COLOR=red
FAMILY="arial")
VALUEATTRS=GraphValueText(SIZE=8pt
WEIGHT=bold
COLOR=black
FAMILY="arial");
endlayout;
endgraph;
end;
run;
%mend;
%test;
DanH_sas
SAS Super FREQ
Hey Vladimir,

The LAYOUT DATALATTICE has the same limitation as PROC SGPANEL in that the headers currently cannot be rotated.

Dan
tma
Calcite | Level 5 tma
Calcite | Level 5

Hi Dan,

 

Is there any solution when column header is truncated when using LAYOUT DATALATTICE?

I am using SAS9.4.

 

Thank you very much,

 

Ting

DanH_sas
SAS Super FREQ

There is not a direct option to prevent truncation, such as wrapping, so that data alignment across cells is maintained. Looking at your template, you are already doing the other things I would have sugested (displaying on ly the values and shrinking the header font). A couple of other thoughts would be to either increase the graph size, or use a format to create a smaller form of your header text.

 

Hope this helps!

Dan 

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2097 views
  • 0 likes
  • 4 in conversation