BookmarkSubscribeRSS Feed
Jaime
Fluorite | Level 6
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;
5 REPLIES 5
DanH_sas
SAS Super FREQ
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
Cynthia_sas
SAS Super FREQ
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
Jaime
Fluorite | Level 6
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.
GraphGuy
Meteorite | Level 14
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.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 690 views
  • 0 likes
  • 4 in conversation