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.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: 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-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
  • 4 replies
  • 1299 views
  • 0 likes
  • 4 in conversation