Data visualization with SAS programming

having html links to a graph

Reply
Contributor
Posts: 47

having html links to a graph

Hi All,

I want to be able to click on a line on a graph and (for arguments sake) go to google.com or yahoo.com. I've attached a link to Robert Allison's code. My question is how do I do the same for a line graph (So far im using Gplot). He's using a Proc Gchart.

Thanks,
Sachin

http://robslink.com/SAS/democd23/overlib.htm
http://robslink.com/SAS/democd23/overlib_info.htm
SAS Employee
Posts: 980

Re: having html links to a graph

In general, with SAS/GRAPH gplot, you can't have drilldowns on the line segment (interpolation between the markers).

You can add drilldowns to the markers, using the same technique as for bar charts (one caveat is that you have to show markers on your line to do that).

You can get a bit "clever", making the markers the same color as the background, and/or annotating 'invisible' areas with drilldowns (corresponding to the lines), etc - but i usually find that showing markers on the lines, and adding drilldowns to those markers, is the best way to go.
Contributor
Posts: 47

Re: having html links to a graph

Hi Robert,

I know this seems like a stupid question but, how do you add markers. Im new to SAS.

Thank you for your patience,
Sachin
SAS Super FREQ
Posts: 925

Re: having html links to a graph

If you have SAS 9.2, you can use a VLINE (summarized) or SERIES (continuous) line plot that will give you drilldown ability across the whole line. Here is a simple example:

[pre]
data test;
set sashelp.class;
if (sex='F') then url="http://www.google.com";
else url="http://www.bing.com";
run;

ods graphics / imagemap=on;
ods listing close;
ods html;
proc sgplot data=test;
vline age / response=height stat=mean group=sex url=url lineattrs=(pattern=solid thickness=2);
run;
ods html close;
[/pre]
Contributor
Posts: 47

Re: having html links to a graph

sorry dan,

only have 9.1.3 Smiley Sad... so back to the markers story.

sachin
SAS Employee
Posts: 980

Re: having html links to a graph

Ok - back to a good-old gplot line plot ... with markers! :-)

Here is an example of a gplot scatter plot - the 'markers' are the dots:

http://robslink.com/SAS/democd23/scat.htm
http://robslink.com/SAS/democd23/scat_info.htm

The shape of the markers is specified in the 'symbol' statement:

symbol1 v=dot height=8 color=cx43a2ca;

If you want lines drawn between the dots, you can add the i= (interpolation) option...

symbol1 v=dot height=8 i=join color=cx43a2ca;

One other tip - you'll want to make sure your data is sorted in the order you want the dots connected.
Ask a Question
Discussion stats
  • 5 replies
  • 190 views
  • 0 likes
  • 3 in conversation