Click here to see the SAS code.
Click here to see the example.
---------------------------------------------------------------
Note: You will need to disable google toolbar popup blocking
(ie, enable popups) for the charttips/drilldowns in this
example to work. The following google doc
seems to indicate you can click the 'popup button' to
add this site to the 'white list', but that doesn't seem
to work in the version of IE/google-toolbar I'm using.
In mine, the note at the bottom of the window says to
"Ctrl+bar" to allow the popup -- that seems to work.
-----
The drilldown in this example is done using a special syntax
that works only in the device=javameta graphs. It allows you
to encode *multipl* drilldowns for each graph element (in this
case each bar in the graph). When the user right-clicks on the
bars, they'll see a "select list" of the multiple drilldowns
they can do on that bar.
Here's the code/syntax for creating character variable that
contains the multiple drilldowns in this example...
length menustring $1000;
menustring=
/* This is the standard html 'flyover/rollover' text */
'ALT="Right-Click to see drilldown choices for '||trim(left(statename))||' " '||
/* These are the menus/drilldowns you see when you right-click */
/* (note that the 'menu=' stuff only works in javameta) */
'MENU=['||
'"'||fipstate(state)||
' Home Page"= '||
'"'||fipstate(state)||
' Superfund Cleanup Sites"= '||
'"'||fipstate(state)||
' EPA Air Quality"= '||
'"'||fipstate(state)||
' Census Facts"= '||
'"'||fipstate(state)||
' Weather Info"= '||
'"'||fipstate(state)||
' Real Estate For Sale"= '||
'"Other Neat Examples!"= '||
']';
Then that variable is specified using the "html=" option in the
SAS/Graph "proc gplot" 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
cframe=white
html=menustring <-------- here!
des="" name="&name" ;
run;
The output is created using ODS HTML, and "goptions device=javameta".
With javameta, only *one* output file is produced - a single html file
containing the basic java "metacodes" to re-draw the graph on the
client end (ie, the web browser). If you look at the html file, you
can see the metacodes, but you won't really be able to identify
which metacodes represent your data (like you could with the
dev=java and dev=activex).
The advantage to dev=javameta is that it even works with very old
versions of java, and you can zoom & pan the graph without losing
resolution in the text & graphics (not such a big advantage in a
simple bar chart like the one in this example, but *very* useful
when you're viewing a very crowded graph or map!). Also, the
multi-drilldown capability is fairly unique to the dev=javameta,
and I do not think there is a way to achieve multiple drilldowns
per each bar using traditional html.
Back to Samples Index