Data visualization with SAS programming

Rotate header labels with LAYOUT DATALATTICE in GTL

Reply
New Contributor
Posts: 4

Rotate header labels with LAYOUT DATALATTICE in GTL

I place header labels on bottom and want to rotate it. Is it possible?

Thank you,
Vladimir
SAS Employee
Posts: 982

Re: Rotate header labels with LAYOUT DATALATTICE in GTL

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?
SAS Super FREQ
Posts: 939

Re: Rotate header labels with LAYOUT DATALATTICE in GTL

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
New Contributor
Posts: 4

Re: Rotate header labels with LAYOUT DATALATTICE in GTL

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;
SAS Super FREQ
Posts: 939

Re: Rotate header labels with LAYOUT DATALATTICE in GTL

Hey Vladimir,

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

Dan
Senior User tma
Senior User
Posts: 1

Re: Rotate header labels with LAYOUT DATALATTICE in GTL

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

SAS Super FREQ
Posts: 939

Re: Rotate header labels with LAYOUT DATALATTICE in GTL

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 

Ask a Question
Discussion stats
  • 6 replies
  • 395 views
  • 0 likes
  • 4 in conversation