BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello~ I've spent a great deal of time formatting a chart in SAS, which I then pulled into Word using ods (rtf file.) Unfortunately, the chart that shows up in Word is cut off, and you can't see all the text. The words in the legend also are longer than the legend box. Am I doing something wrong?

Any help would be greatly appreciated, I would like to automate these tables rather than copying & pasting. Thanks! My SAS code is below.

/* FORMAT CHART 1 */
ods rtf file="N:\2008\08-0116\mkt_sci\Lynn\Output\forreport.rtf"; *style=minimal;

goptions reset=all cback=white norotate; *rotate=landscape;

title1
font='Arial' height=2.5 'Overall Satisfaction with *****';
title2
font='Arial' height=2 'Mean Score and Top Box Percent';

symbol1
line=1 /* Specifies type of line (solid, dotted, etc) */
interpol=join /* Joins points together */
color=navy /* Specifies color of line */
cv=navy /* Specifies color of plot symbol */
width=1 /* Specifies width of plot symbol */
value=none; /* Specifies what symbol is */
symbol2
line=2
interpol=join
color=navy
cv=navy
width=1
value=none;

axis1
label=none value=(font=arial height=1.5 angle=90 'Jun-06' 'Jul-06' 'Aug-06' 'Sep-06'
'Oct-06' 'Nov-06' 'Dec-06' 'Jan-07' 'Feb-07' 'Mar-07' 'Apr-07' 'May-07' 'Jun-07'
'Jul-07' 'Aug-07' 'Sep-07' 'Oct-07' 'Nov-07' 'Dec-07' 'Jan-08' 'Feb-08' 'Mar-08'
'Apr-08' 'May-08' 'Jun-08') offset=(2) width=3 order=(218 to 242 by 1);


axis2
label=(font=arial height=1.5 'Mean' justify=right 'Score') value=(font=arial height=1.5)
order=(-2 to 2 by 1) width=3;
axis3
label=(font=arial height=1.5 'Top Box' justify=left 'Percent') value=(font=arial height=1.5)
order=(0 to 100 by 25) width=3;

legend1
cborder=black /* Border for legend */
position=inside /* Places legend inside chart */
mode=protect /* Legend covers any points that would otherwise appear in the same place */
value=(font=arial height=2 tick=1 'Mean Score' tick=2 'Percent saying "Very Satisfied"') across=1 label=none;

proc format;
picture pctfmt (round)
0-high='000%';
run;

/* CHART 1 */
ods rtf file="N:\2008\08-0116\mkt_sci\Lynn\Output\chart1.rtf"; *style=minimal;
proc gplot data=mvr.chart;
format mtopq1 pctfmt.;
plot meanq1*wave=1 mtopq1*wave=2/overlay haxis=axis1 hminor=0
vaxis=axis2 vminor=0 legend=legend1 vref=0;
plot2 mtopq1*wave=2/vaxis=axis3 vminor=0 legend=legend1;
run; quit;
ods rtf close;
3 REPLIES 3
Bill
Quartz | Level 8
Lynn;

I don't see any reference to a specific graphics device after reset=all. For input to Word, I think that the best one to use is the png driver.

Some code below that I've used in the past. It produces a png file that can be imported into Word.

goptions reset=all
rotate=landscape
ftext="helvetica"
htext=2.0
xmax=6in ymax=3.5in xpixels=1800 ypixels=1050

dev=png gsfmode=replace;

filename grf1 '\\technology\qualsysshare\groupspecific\reportsmonthly\reapcovr.png';

goptions gsfname=grf1;

proc gslide frame lframe=14 wframe=20 cframe=steel;
note h=4;
note h=8 j=c "PRODUCT QUALITY REPORT";
note h=2;
run;
quit;

wd
Andre
Obsidian | Level 7
Lynn,
Did you follow the advice of
http://support.sas.com/techsup/technote/ts674/ts674.html

i have read your text this european morning.i did not reply due to lack of data
which could be better forwarded on sas-l than here (as this could be too long).
I agree with Bill advice for png ; you have no dimension vsize/hsize or
change in xmax/ymax xsize/ysize?
It seems to me that you have adjust your graphic to pure sas graph (gseg dimension screen)
For me the first question in graphic sas matter is What kind of final graph do you want to produce?
Pulling into Word? what does it mean for you?
See also http://robslink.com/SAS/democd11/aaaindex.htm where you can see images and code everytime with greatly varying.goptions

Andre
deleted_user
Not applicable
Thank you both so much for your replies! They were extremely helpful for a novice SAS user like myself.

Bill, I used pieces of the code you posted and am now able to generate the graph I need.

Andre, I am using the SAS support document you referenced to figure out how to output my tables and graphs in one Word document using ODS. And the other link you provided is a great reference!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 3 replies
  • 825 views
  • 0 likes
  • 3 in conversation