The SAS Output Delivery System and reporting techniques

SGRENDER

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

SGRENDER

Can you please help me change all the fonts in the SGRENDER output to georgia?

 

data test;
	infile datalines dlm='|';
	input year :8. var :$3. val :8.;
datalines;
2014|RUC|17
2015|RUC|19
2016|RUC|22
2017|RUC|25
2018|RUC|26
2019|RUC|29
;run;

ods path (prepend) work.template(update);
proc template;
	define style graphfonts;
	parent=styles.default;
		style graphfonts from graphfonts /
			'graphdatafont'=('georgia',8pt)
			'graphlabelfont'=('georgia',8pt)
			'graphfootnotefont'=('georgia',8pt)
		;
	end;
	define statgraph econ_data_plots;
		begingraph / designwidth=650 designheight=350;
			dynamic val time graphtitle;
			entrytitle graphtitle /*halign=left*/ /*textattrs=(family="georgia")*/;
				layout lattice / rows=1 columns=1 rowgutter=10 columngutter=10;
					layout overlay;
						seriesplot x=time y=val / lineattrs=(pattern=dash color=blue);
					endlayout;	
				entryfootnote halign=left "Solid 2015Q3, Dash 2015Q2";
				endlayout;
		endgraph;
	end;
run;

proc sgrender data=test template=econ_data_plots;
	dynamic graphtitle='Scenario' val='val'	time='year' ;
run;

Accepted Solutions
Solution
‎11-04-2015 10:13 AM
SAS Super FREQ
Posts: 620

Re: SGRENDER

In order for the new style to be used, it has to be specified when opening a ODS destination.

 

So your code should look similar to the one below:

ods html file="c:\temp\sample.html"
style=graphfonts
;

proc sgrender data=test template=econ_data_plots;
	dynamic graphtitle='Scenario' val='val'	time='year' ;
run;

ods html close;

Bruno

View solution in original post


All Replies
Solution
‎11-04-2015 10:13 AM
SAS Super FREQ
Posts: 620

Re: SGRENDER

In order for the new style to be used, it has to be specified when opening a ODS destination.

 

So your code should look similar to the one below:

ods html file="c:\temp\sample.html"
style=graphfonts
;

proc sgrender data=test template=econ_data_plots;
	dynamic graphtitle='Scenario' val='val'	time='year' ;
run;

ods html close;

Bruno

New Contributor
Posts: 3

Re: SGRENDER

With some slight adjustments to take care of the other graph font definitions...  This worked like a champ, thanks Bruno

ods path (prepend) work.template(update);
proc template;
	define style graphfonts;
	parent=styles.default;
		style graphfonts from graphfonts /
			'graphdatafont'=('georgia',8pt)
			'graphlabelfont'=('georgia',8pt)
			'graphfootnotefont'=('georgia',8pt)
			'graphvaluefont'=('georgia',8pt)
			'graphtitlefont'=('georgia',8pt)
		;
	end;
	define statgraph econ_data_plots;
		begingraph / designwidth=650 designheight=350;
			dynamic val time graphtitle;
			entrytitle graphtitle;
				layout lattice / rows=1 columns=1 rowgutter=10 columngutter=10;
					layout overlay;
						seriesplot x=time y=val / lineattrs=(pattern=dash color=blue);
					endlayout;	
				entryfootnote halign=left "Solid 2015Q3, Dash 2015Q2";
				endlayout;
		endgraph;
	end;
run;

ods html style=graphfonts;
proc sgrender data=test template=econ_data_plots;
	dynamic graphtitle='Scenario' val='val'	time='year' ;
run;
Post a Question
Discussion Stats
  • 2 replies
  • 372 views
  • 0 likes
  • 2 in conversation