Data visualization with SAS programming

Adding a clickable URL link to an entire graph using sgrender

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Adding a clickable URL link to an entire graph using sgrender

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? 


Accepted Solutions
Solution
‎02-02-2016 02:10 PM
SAS Super FREQ
Posts: 1,078

Re: Adding a clickable URL link to an entire graph using sgrender

[ Edited ]

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


All Replies
SAS Super FREQ
Posts: 3,386

Re: Adding a clickable URL link to an entire graph using sgrender

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.

Trusted Advisor
Posts: 1,210

Re: Adding a clickable URL link to an entire graph using sgrender

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.

Solution
‎02-02-2016 02:10 PM
SAS Super FREQ
Posts: 1,078

Re: Adding a clickable URL link to an entire graph using sgrender

[ Edited ]

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.

Occasional Contributor
Posts: 7

Re: Adding a clickable URL link to an entire graph using sgrender

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.

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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