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,
but in the annotate dataset rather than in the bar/response data
as was shown in a previous example (using annotate is a little 
trickier, but the syntax for the html charttip & drilldown is 
basically the same, except the variable *must* be named 'html') ...

First, a character variable is created in the annotate dataset, 
containing the html tags for the drilldown (href=) and the text 
charttip/rollover-text (title=) as follows -- this particular
annotate example annotates the text value of the full-name of
the state onto the end of each bar ...

   data myanno; set mydata;
   length html $500 text $20;
   xsys='2'; ysys='2';
   function='label';
   position='4';
   midpoint=st;
   x=population;
   when='a';
   text=trim(left(fipnamel(stfips(st))));
   html='title='||quote(
    'State: '|| trim(left(st)) ||'0D'x||
    'Population: '|| trim(left(put(population,comma12.0)))
   )
   ||' '||
    'href="http://www.state.'||trim(left(lowcase(st)))||'.us"';
   run;


Then, when that annotate is used by a sas/graph proc, it automatically
uses the 'html' variable as a charttip & drilldown.

   proc gchart data=mydata anno=myanno;
   hbar st / discrete
    type=sum sumvar=population
    ascending
    nostats
    maxis=axis1
    raxis=axis2
    autoref cref=gray
    clipref
    coutline=black
    des="" name="&name" ;
   run;


And 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