BookmarkSubscribeRSS Feed
☑ This topic is solved. 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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 195 views
  • 0 likes
  • 2 in conversation