BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
olsengf
Fluorite | Level 6

I have a line graph, using proc template and statgraph, and proc sgrender. I've defined a URL variable within the data set and I have the code url=url within my template, which allows the line on the line graph to be a clickable link. Is there anyway to make the background or white space of the graph clickable as well? 

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

The suggestion by others should work.  However, if you want to have the entire graph to be clickable (including outside the data area), you could use an annotated transparent rectangle with a URL on the whole graph area.

View solution in original post

4 REPLIES 4
Rick_SAS
SAS Super FREQ

I've never done this, but it seems like you could use the POLYGONPLOT statement to draw a rectangle that goes from

(min(X), min(Y)) to (max(X), max(Y)).  Make the rectangle 100% transparent so it doesn't show up, but use the URL= option to specify the URL.

 

If you plot the rectangle last within your LAYOUT OVERLAY block, then it should direct all clicks in the plot are to the specified URL.  If you plot the rectangle first, then clicks on a line could go to one URL, and clicks that do not touch a line would go elsewhere.

Quentin
Super User

I don't know if you can make the background clickable.  But you could probably overlay an invisible / transparent plot on top of it, and define a URL for that.   I've overlaid invisibile bar charts for similar reasons.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Bart Jablonski and I present 53 (+3) ways to do a table lookup on Wednesday Sep 18.
Register now at https://www.basug.org/events.
Jay54
Meteorite | Level 14

The suggestion by others should work.  However, if you want to have the entire graph to be clickable (including outside the data area), you could use an annotated transparent rectangle with a URL on the whole graph area.

olsengf
Fluorite | Level 6

Thank you all for the input. I added this line of code:

drawrectangle x=0 y=0 width=100 height=100 / ANCHOR=BOTTOMLEFT display=all transparency=1 layer=back url="&urlLink";

within my statgraph template and it works perfectly.

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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