Dear all,
I have a problem in generation ODS graphics out of proc sgpanel. Everything is working except the generation of the title.
Below a general example. It would be nice if you can give my an advice how i can solve this problem. Gtitle and nogtitle are not working as expected or I use them wrongly.
graphics on /reset=all imagename="test";
html path="&path." (url=none)
image_dpi=200 gtitle ;
proc sgpanel data=sashelp.heart noautolegend;
title "Cholesterol Distribution in Heart Study";
panelby sex;
histogram cholesterol;
density cholesterol;
;
Many thanks in advance.
Best regards,
Martin
Please describe the issue in more detail. Is the title not appearing at all? In the wrong location?
Possibly no output at all?
With path you may want to specify body="HeartChart.Html" on the ods destination.
also be aware that this forum does bad things to code copied directly from the SAS editor and pasted when using Internet Explorer. I suspect that as a minimum you lost two ODS and a run; in the pasted text.
Yes, the title is not appearing at all but I recieve output.
When I use proc sgplot it is working but not with proc sgpanel.
Many thanks @ballardw, your tipp to specify body="HeartChart.Html" on the ods destination works.
best,
Martin
Just to confirm, you don't see the title anywhere: in the graphical image (GTITLE) or outside the graphical image (NOGTITLE)?
Yes exactly, I do not see the title anywhere.
Hi:
Your code got garbled when you posted it. When I run this code:
ods graphics on /reset=all imagename="test";
ods html path="c:\temp" (url=none) file='test_title_GT.html'
image_dpi=200 gtitle ;
proc sgpanel data=sashelp.heart noautolegend;
title "1) Cholesterol Distribution in Heart Study";
panelby sex;
histogram cholesterol;
density cholesterol;
run;
ods html close;
ods html path="c:\temp" (url=none) file='test_title_NOGT.html'
image_dpi=200 nogtitle ;
proc sgpanel data=sashelp.heart noautolegend;
title "2) Cholesterol Distribution in Heart Study";
panelby sex;
histogram cholesterol;
density cholesterol;
run;
ods html close;
;
I get these results -- with the title visible. Created in SAS 9.4. However, in the #1 code output, the title is INSIDE the "box/frame" of the image because of the GTITLE option.
Changing the GTITLE to NOGTITLE results in this -- notice how the title is now OUTSIDE the box of the image and in a slightly bigger font and in the color used for the HTML default style. BTW, if you open #2 OUTSIDE of a browser, then you won't see the title in the image because the title "belongs" to ODS HTML output.
If you run the code that I posted and do NOT get these results, then your best resource is to open a track with Tech Support.
Cynthia
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.
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.