BookmarkSubscribeRSS Feed
LukeL
Obsidian | Level 7

Hi all.

I have the need to put some gkpi output on a pdf, but I'm not able to make them the right size. After a certain dimension on the pdf, the graph remain the same size, and only the white border around increae. Is there something I can do? The code I use is something like the following. Thanks 🙂

 

ods _all_ close;
ods escapechar="^"; 
ods graphics on / reset=all border=off MAXLEGENDAREA=50;
options orientation=PORTRAIT papersize=A3 /* 420x297 */
	topmargin=1cm bottommargin=1cm leftmargin=1.5cm rightmargin=0.5cm
	nodate center nonumber;

ODS PDF file="%quote(&outfilepath./&folder./&filenamedef..pdf)" color=yes style=customDmSintA3
STARTPAGE=no bookmarkgen=no dpi=150 nogtitle nogfootnote compress=9;

ods layout absolute y=5cm height=5.5cm;
    goptions reset=goptions hsize=4cm vsize=4cm noborder;

    ods region x=0cm width=9cm;
        proc gkpi mode=basic;
            dial actual=5 bounds=(1 10 15) /
                target=8 nolowboundary
                colors=(cx84AF5B cxD06959);
        run;
    ods region x=9cm width=9cm;
        proc gkpi mode=basic;
            dial actual=50 bounds=(1 60 90) /
                target=40 nolowboundary
                colors=(cx84AF5B cxD06959);
        run;
    ods region x=18cm width=9cm;
        proc gkpi mode=basic;
            dial actual=91 bounds=(1 180 270) /
                target=100 nolowboundary
                colors=(cx84AF5B cxD06959);
        run;
ods layout end;

ods pdf close;
5 REPLIES 5
ballardw
Super User

You may need to look at adjusting the height and width using the ODS graphics options:

 

ods graphics/ height=1in width=2in; or similar before each procedure call if you want different graphics sizes.

LukeL
Obsidian | Level 7

It seems that proc gkpi is not affected from those options 😞

ballardw
Super User

Try the xpixels and ypixels on goptions instead of hsize vsize.

LukeL
Obsidian | Level 7

xpixels and ypixels behave same of the vsize... If you go down in size, the output goes smaller. But if you increae the values, just the around square of the image increase, lefting the image itself the same size... -.-"

Cynthia_sas
SAS Super FREQ
Hi: PROC GKPI is not controlled by ODS GRAPHICS options, since it is a SAS/GRAPH procedure. So the suggestions to use GOPTIONS is a good one. You do not show your DEVICE= option, but the doc clearly explains that you need to use DEVICE=JAVAIMG, as shown in this example: https://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#a003178224.htm

But ultimately, I think you may want to work with Tech Support on this question. All of the examples in the DOC are ODS HTML examples and if you are seeing behavior that is not acting in ODS PDF as you wish, then it might be because ODS PDF does not play nice with the way GKPI works.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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