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: Rick Wicklin presents Ten Tips for Effective Statistical Graphics (with SAS code) on Wednesday March 26.
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-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1757 views
  • 0 likes
  • 4 in conversation