Data visualization with SAS programming

sgplot: vline datalabel font size

Reply
Regular Contributor
Posts: 195

sgplot: vline datalabel font size

Does anyone know how to increase the font size for datalabel?
proc sgplot data=yrp;
vbar yoi / response=yr_tot;
vline yoi / response=avg y2axis datalabel=avg;
y2axis min=0 max=10000;
run;
Thank you.
SAS Super FREQ
Posts: 889

Re: sgplot: vline datalabel font size

Hey,

For now, you must adjust the size through the ODS style. Here is a simple example:
[pre]
proc template;
define style biglabel;
parent=styles.listing; /* or your favorite style */
style GraphDataText from GraphDataText /
fontsize=10pt;
end;
run;

ods listing style=biglabel;
proc sgplot data=sashelp.class;
scatter x=weight y=height / datalabel;
run;
[/pre]

Hope this helps,
Dan
Regular Contributor
Posts: 195

Re: sgplot: vline datalabel font size

A png file was created that looked correct.
However the graph in my rtf file (I'm using ods rtf) did not reflect the change.
Thank you.
SAS Super FREQ
Posts: 8,717

Re: sgplot: vline datalabel font size

Hi:
You might be looking at the old file, especially if Word was still open when you reran your code. Are you seeing any messages in the log, such as:
[pre]
ERROR: File is in use, C:\temp\report.rtf.
[/pre]

cynthia
SAS Super FREQ
Posts: 889

Re: sgplot: vline datalabel font size

Also make sure you specified the style on the ODS RTF statement.
Regular Contributor
Posts: 195

Re: sgplot: vline datalabel font size

You are correct. I didn't add the style to ods rtf statement. Thank you.
SAS Super FREQ
Posts: 889

Re: sgplot: vline datalabel font size

One other note: the default style for ODS RTF is the RTF style. You may want to change the PARENT in the BIGLABEL style to be styles.rtf to get your previous output appearance.

Thanks!
Dan
Ask a Question
Discussion stats
  • 6 replies
  • 1102 views
  • 0 likes
  • 3 in conversation