BookmarkSubscribeRSS Feed
Martinka
Calcite | Level 5

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

6 REPLIES 6
ballardw
Super User

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.

Martinka
Calcite | Level 5

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.

Martinka
Calcite | Level 5

Many thanks @ballardw, your tipp to specify body="HeartChart.Html" on the ods destination works.

best,

Martin

patelshree
Fluorite | Level 6

Just to confirm, you don't see the title anywhere: in the graphical image (GTITLE) or outside the graphical image (NOGTITLE)?

Martinka
Calcite | Level 5

Yes exactly, I do not see the title anywhere.

Cynthia_sas
SAS Super FREQ

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.

gt.png

  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.

nog.png

  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

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