BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AScraeyen
Fluorite | Level 6

Hello, I wrote some proc templates to create some graphs and pies, but after outputting them for export to excel, they become extremely small. Even in excel it takes the size of 1 row and even smaller. What am I doing wrong?

Here is an example of my Macro to create a pie:

 

%macro Pie_S(Category, response, dataIn);

 

proc template;
define statgraph pie_S;
begingraph / datacolors=(&fillcolors_graphs_S) attrpriority=none;
layout region;
piechart category=&Category response=&response / outlineattrs=(pattern=2 color=lightgrey)
datalabellocation=outside
categorydirection=clockwise
start=90
name= 'pie';
endlayout;
endgraph;
end;
run;

proc sgrender data=&datain template=pie_S ;
run;

 

%mend Pie_S;

 

I export with ODS Excel (for confidentiality reasons I've put X's where needed):

 

ods excel file= "XXXX.xlsx";
ods excel options(sheet_name='XXX' embedded_titles='no');
%pie_s(gegevens,percentage,XXX);
ods excel options(sheet_name='XXX' embedded_titles='no');
%pie_s(gegevens,percentage,XXX);
ods excel options(sheet_name='XXX' embedded_titles='no');
%pie_s(gegevens,percentage,XXX);
ods excel close;

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
AScraeyen
Fluorite | Level 6

I found the mistake I made. In the overall code, I left a ods graphics with the wrong size (I mixed up inches, pts and cm, as I usually use the European standards). Removing the ods graphic and letting SAS choose the best format, solved the problem. 

View solution in original post

4 REPLIES 4
ballardw
Super User

What are your current settings for ODS GRAPHICS options?

 

You may need to specify some size units in Height and Width options such as

ODS GRAPHICS Height=5in Width=7in;

which would set the display to 5 inches by 7 inches Or the equivalent in the GTL  DESIGNWIDTH and DESIGNHEIGHT options of STATGRAPH in your template. The defaults are defined in pixels and with a high resolution screen pixels are pretty small.

AScraeyen
Fluorite | Level 6

Unfortunately, I tried already to fix the size, but that doesn't change this problem. I can make graphs one moment, and the next time I run my code, they become really really small... 

AScraeyen
Fluorite | Level 6

with 5in on 5in it gives the same result in sas (and the same size in excel):

AScraeyen_0-1647607427819.png

rather small and difficult to read /  analyse, no? 

AScraeyen
Fluorite | Level 6

I found the mistake I made. In the overall code, I left a ods graphics with the wrong size (I mixed up inches, pts and cm, as I usually use the European standards). Removing the ods graphic and letting SAS choose the best format, solved the problem. 

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
  • 4 replies
  • 363 views
  • 0 likes
  • 2 in conversation