Click here to see the SAS code.
Click here to see the example.

---------------------------------------------------------------

The drilldown in this example is done in the traditional SAS/Graph way,
with a little extra "twist" in that the drilldowns are to html 
"anchors" on to additional graphs on the same page as the top-level
graph.


First, a character variable is created, containing the html tags for
the drilldown (href=) and the text charttip/rollover-text (title=) 
as follows - notice the '#' is used to denote the url is an 'anchor' ...

   htmlvar='title='||quote(
    'State: '|| trim(left(st)) ||'0D'x||
    'Population: '|| trim(left(put(population,comma12.0)))
   )
   ||' '||
    'href="#'||trim(left(lowcase(st)))||'"';


Then that variable is specified using the "html=" option in the
SAS/Graph "proc gchart" as follows...

   proc gchart data=mydata;
   hbar st / discrete
    type=sum sumvar=population
    ascending
    nostats
    maxis=axis1
    raxis=axis2
    autoref cref=gray
    clipref
    coutline=black
    html=htmlvar            <--------  here!
    des="" name="&name" ;
   run;

That was for the first/top-level graph.
For the additional graphs, you need to "append" them to the same page,
and use the "ods html" anchor option to output an 'anchor' ...

   %let state=va;
   ods html anchor="&state";
   title "&state";
   proc gmap data=mydata map=maps.us (where=(state = stfips("&state")));
   id state;
   choro state / levels=1 coutline=black nolegend html=htmlvar2 des="" name="&state" ;
   run;


The output is created using ODS HTML, and "goptions device=gif",
so that a gif file is created containing the gif, and an html file 
is created containing the html charttips & drilldowns.  The user will
view the html file, and it will display the gif image.


Back to Samples Index