Data visualization with SAS programming

Different Links for different Bars

Reply
Frequent Contributor
Posts: 115

Different Links for different Bars

Hi all,

Using a sgplot to display 3 bars. I want each bar to link to a different URL. For some reason my sgplot only creates the link for the lasst bar.

Below is my code. The 3rd bar, reponse=Handled, is the only one working.

proc sgplot data=Current_Pipeline (where=(Week_Ending_On>today()-15*7 and Week_Ending_On vbar Week_Ending_On/ response=Created nooutline barwidth=.9 fillattrs=(color=cxA6D96A) datalabel url=urlString;
vbar Week_Ending_On/ response=StillOpen nooutline barwidth=.9 fillattrs=(color=black) datalabel url=urlOpen;
vbar Week_Ending_On/ response=Handled nooutline barwidth=.9 fillattrs=(color=cxF46D43) datalabel url=urlHandled;
yaxis display=(nolabel) ;
xaxis display=(nolabel) grid;
keylegend /location =inside position=topright noborder location=outside ;
format Week_Ending_On mmddyy5.;
run;
SAS Super FREQ
Posts: 890

Re: Different Links for different Bars

Hey Jaime,

Currently, the categorical charts (bar, line, and dot) are able to use only one URL column per graph. However, if I interpret your intent correctly, you should be able to combine your three URL columns into the same column and reference that column from all three bar chart statements. Let me know if that works for you.

Thanks!
Dan
SAS Super FREQ
Posts: 8,721

Re: Different Links for different Bars

Hi:
Remember that when you post code to the forum anything related to HTML tags can throw off the posting mechanism and truncate your post (anything meaning < and > symbols -- which are also part of HTML tags).

This previous forum posting explains how to protect your symbols
http://support.sas.com/forums/thread.jspa?messageID=27609毙

Using &lt; for < and &gt; for > as well as how to use se the [pre] and [/pre] tags around your code and output in order to maintain indenting and spacing.

It's not clear to me what's up with your bars -- are you overlaying the bars or having them side-by-side? It seems as though the last URL is the one used -- which is what I would expect if you were overlaying the bars, one on top of the other.

cynthia
SAS Employee
Posts: 967

Re: Different Links for different Bars

Frequent Contributor
Posts: 115

Re: Different Links for different Bars

Thanks all,

As per DanH's post, I think I might have to listen to Robert and dust off the old gchart procedure. The only problem is that I ned to overlay the bars. I dont remember if gchart allows that.
SAS Employee
Posts: 967

Re: Different Links for different Bars

Here's an example where I use gchart, and produce "overlapping" bars...

http://robslink.com/SAS/democd29/robslink.htm

http://robslink.com/SAS/democd29/robslink_info.htm

Note that I let gchart draw the first bar (back-most bar), and then I annotate the overlapping bars. You can control the charttip/drilldowns of the gchart bars using gchart vbar's html= option, and the charttip/drilldowns of the overlapping annotated bars using the 'html' variable in the annotate data set.
Ask a Question
Discussion stats
  • 5 replies
  • 200 views
  • 0 likes
  • 4 in conversation