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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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