The SAS Output Delivery System and reporting techniques

bar chart squashed

Reply
N/A
Posts: 0

bar chart squashed

I'm trying to output this bar chart with 'Courier New' text, as soon as I specify FTEXT = 'Courier New' in the GOPTIONS, the output becomes very squashed and narrow.

When I don't specify FTEXT within GOPTIONS it looks as though I get the default 'Simulate' text although the width of the graphical output is fine.

I've tried changing the HSIZE/VSIZE options along with trying XPIXELS/YPIXELS but having no effect for me. I'm sending the output to ODS RTF.

Any ideas??
N/A
Posts: 0

bar chart squashed

Posted in reply to deleted_user
my sample code ....

**** INPUT SAMPLE PAIN SCALE DATA.;
data pain;
label subject = "Subject"
pain = "Pain Score"
trt = "Treatment";
input subject pain trt @@;
datalines;
113 1 1 420 1 2 780 0 3
121 1 1 423 0 2 784 0 3
122 1 1 465 4 2 785 1 3
124 4 1 481 3 2 786 3 3
164 4 1 482 0 2 787 0 3
177 4 1 483 0 2 789 0 3
178 0 1 484 0 2 790 2 3
179 1 1 485 0 2 791 0 3
184 0 1 486 1 2 793 3 3
185 0 1 487 0 2 794 2 3
186 3 1 489 0 2 795 1 3
187 0 1 490 1 2 796 4 3
188 1 1 491 0 2 797 2 3
189 3 1 493 2 2 798 1 3
190 3 1 494 1 2 799 2 3
191 2 1 495 0 2 800 2 3
192 3 1 496 2 2 822 1 3
193 4 1 498 0 2 841 1 3
194 4 1 499 2 2 842 1 3
195 0 1 500 2 2 847 2 3
196 4 1 521 1 2 863 1 3
197 1 1 522 1 2 881 2 3
198 4 1 541 1 2 966 1 3
199 3 1 542 0 2 967 0 3
100 4 1 561 3 2 968 0 3
121 2 1 562 2 2 981 1 3
122 2 1 581 2 2 982 1 3
123 4 1 561 1 2 985 0 3
124 2 1 564 1 2 986 0 3
141 3 1 566 1 2 987 0 3
142 2 1 567 2 2 989 2 3
143 2 1 568 2 2 990 3 3
147 4 1 569 0 2 991 0 3
161 4 1 581 0 2 992 2 3
162 4 1 582 3 2 993 1 3
163 4 1 584 1 2 994 0 3
164 0 1 585 0 2 995 1 3
165 2 1 586 1 2 996 0 3
166 1 1 587 1 2 997 3 3
167 3 1 591 1 2 998 0 3
181 2 1 592 1 2 999 0 3
221 4 1 594 1 2 706 0 3
281 4 1 595 0 2 707 3 3
282 4 1 596 0 2 708 1 3
361 4 1 597 0 2 709 0 3
362 4 1 601 0 2 710 1 3
364 3 1 602 1 2 711 1 3
365 4 1 603 2 2 712 0 3
366 3 1 604 1 2 713 4 3
367 4 1 605 1 2 714 0 3
;

**** MAKE FORMATS FOR CHART.;
proc format;
value trt
1 = 'Placebo'
2 = 'Old Drug'
3 = 'New Drug';

value score
0 = '0'
1 = '1-2'
2 = '3-4'
3 = '5-6'
4 = '7-8';

picture newpct (round)
0 = " "
0 < - < .5 = "<1%"
.6 < - high = "000%";
run;

proc sort
data = pain;
by trt;
run;
N/A
Posts: 0

bar chart squashed

Posted in reply to deleted_user
sample code continued (wouldn't fit in one post in the preview window) ....

**** GET FREQUENCY COUNTS FOR CHART AND PUT IN FREQOUT DATA SET.;
proc freq
data = pain
noprint;
by trt;

tables pain /out = freqout;
run;


**** NEED PROC TEMPLATE STEP TO CONTROL PAGE MARGINS;
PROC TEMPLATE;
DEFINE STYLE MYTHEME;
PARENT = STYLES.THEME;
REPLACE BODY FROM DOCUMENT
"UNDEF MARGINS SO WE GET THE MARGINS FROM THE PRINTER OR SYS OPTION"
/
BOTTOMMARGIN = _UNDEF_
TOPMARGIN = _UNDEF_
RIGHTMARGIN = _UNDEF_
LEFTMARGIN = _UNDEF_;
END;
RUN;


**** OPEN ODS DESTINATION, SET PAGE ORIENTATION AND MARGINS IN OPTIONS STATEMENT
**** INCLUDE THE STYLE (MYTHEME) CREATED FROM PROC TEMPLATE STEP;
OPTIONS ORIENTATION=LANDSCAPE TOPMARGIN=2.12 CM BOTTOMMARGIN=2.54 CM NODATE NONUMBER;
ODS LISTING CLOSE;
ODS NORESULTS;
ODS RTF FILE="C:\TEMP\TEST2.RTF" STYLE=MYTHEME;


**** DEFINE GRAPHICS OPTIONS: SET DEVICE DESTINATION TO MS
**** OFFICE CGM FILE, REPLACE ANY EXISTING CGM FILE, RESET ANY
**** SYMBOL DEFINITIONS, AND SET BACKGROUND TO WHITE AND OTHER **** COLORS TO BLACK.;
goptions reset = all
VSIZE = 6IN
HSIZE = 9IN
cback = white
colors = (black)
FTEXT = 'Courier New';


**** DEFINE BAR PATTERNS: WHITE = PLACEBO, GRAY = OLD DRUG,
**** BLACK = NEW DRUG.;
pattern1 value = solid color = white;
pattern2 value = solid color = gray;
pattern3 value = solid color = black ;

**** DEFINE HORIZONTAL AXIS OPTIONS.;
axis1 label = (h = 1 'Pain Score')
value = (h = 1 )
order = (0 to 4 by 1);

**** DEFINE VERTICAL AXIS OPTIONS.;
axis2 label = (h = 1.2 r = 0 a = 90 'Percentage of Patients' )
order = (0 to 50 by 10);

**** CREATE BAR CHART. PERCENTAGE OF PATIENTS IS ON THE Y AXIS,
**** PAIN SCORE BY TREATMENT IS ON THE X AXIS.;
proc gchart
data = freqout;

vbar3d pain /group = trt
sumvar = percent
maxis = axis1
raxis = axis2
midpoints = 0 1 2 3 4
cframe = white
coutline = black
outside = sum
patternid = group;

format trt trt.
pain score.
percent newpct.;
title1 j = c h = 1.5 color = black
"Figure 6.3";
title2 j = c h = 1.5 color = black
"Summary of Pain Score by Treatment";

run;
quit;


ODS RTF CLOSE;
ODS RESULTS;
ODS LISTING;
SAS Super FREQ
Posts: 8,866

Re: bar chart squashed

Posted in reply to deleted_user
Hi:
I tried FTEXT='Courier New' in SAS 9.2 and the font looked OK. Your best bet for help on this issue may be to contact SAS Tech Support.

There is also a good discussion of FONTS and RTF/Word in this Tech Support document:
http://support.sas.com/techsup/technote/ts674/ts674.html

To open a track with Tech support, go to:
http://support.sas.com/ctx/supportform/createForm

cynthia
N/A
Posts: 0

Re: bar chart squashed

Posted in reply to Cynthia_sas
Thanks Cynthia,

The font looks fine using Courier New, it's the actual size of the bar chart which become much smaller.

I've opened a track with Tech Support.

John.
SAS Super FREQ
Posts: 8,866

Re: bar chart squashed

Posted in reply to deleted_user
Hi:
Good you're working with Tech Support...I meant to write back that both my font and the bar chart looked OK. Nothing mis-shaped.

cynthia
Ask a Question
Discussion stats
  • 5 replies
  • 156 views
  • 0 likes
  • 2 in conversation