Data visualization with SAS programming

Hyperlink in Graph Title

Reply
Trusted Advisor
Posts: 1,265

Hyperlink in Graph Title

I am under the impression that the only way to have clickable hyperlinks above my graphs is to use the ODS HTML option NOGTITLE. (Correct, or not?)

So, when I use NOGTITLE in the ODS HTML statement, the titles, which previously were nicely centered above the actual graph, are no longer centered above the graph. It's like the graph uses one axis for centering, and the titles use a different axis for centering. Is there some way I can produce this graph so that titles are centered above the graph?

SAS 9.3, Windows 7 ProExample Output.png

SAS Super FREQ
Posts: 8,641

Re: Hyperlink in Graph Title

Hi:

  You didn't post any code, so it's hard to comment on why your link did not work. When I use LINK= on the TITLE statement, as shown in the following code, my link is clickable. I did have to click in Internet Explorer to enable blocked content first in order to make the hyperlink active, but other than that, it worked for me.

cynthia

ods html path='c:\temp' (url=none)

         file='uselink.html'  gtitle;

   

proc gchart data=sashelp.class;

  title link='http://www.sas.com' 'Click to Go to SAS';

  vbar age /discrete;

run;

quit;

  

ods html close;

Trusted Advisor
Posts: 1,265

Re: Hyperlink in Graph Title

The issue isn't getting the hyperlinks to work; they do work. The issue is getting the titles centered above the plot (or the plot centered below the titles), which was not an issue before I added the NOGTITLE option to the ODS HTML statement.

Nevertheless, I have figured out what I was doing wrong, so I consider the problem to be solved.

SAS Super FREQ
Posts: 8,641

Re: Hyperlink in Graph Title

Hi:

  Good, glad you got it working.

  In your first sentence in the original post, you had this:

"I am under the impression that the only way to have clickable hyperlinks above my graphs is to use the ODS HTML option NOGTITLE. (Correct, or not?)"

  My program was showing that you could have clickable hyperlinks without NOGTITLE. This means that if you use links in your TITLE and put the TITLE inside the GRAPH (using GTITLE); then 2 things happen: 1) the links are clickable (answers your first question) and 2) with GTITLE, the titles are centered above the image.

If the TITLE is placed outside the GRAPH image (using NOGTITLE), then the title is centered to the page, not to the image.

  Links are clickable in either mode (GTITLE or NOGTITLE). Sorry I wasn't clear about which question I was answering.

cynthia

Trusted Advisor
Posts: 1,265

Re: Hyperlink in Graph Title

Okay, thanks for pointing that out, that is useful information!

Post a Question
Discussion Stats
  • 4 replies
  • 306 views
  • 0 likes
  • 2 in conversation