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

Click here to see an alternate version, with onMouseover w/ county maps in the mouseover window!

-----

See my blog for more information about this graph!


This example demonstrates 2 different ways to show the same 
election data.  

The first is the 'Treemap' in which each rectangle represents 
a 'state' (of the united states), and the size of the rectangle 
represents how many electoral votes that state has in the election.
The color of the rectangle represents which candidate won the 
votes from that state.  To tie-in the color with the candidate,
a picture of each candidate is annotated, and a colored rectangle
is annotated behind the picture.  This Treemap was created
using some macros I wrote to generate a special sas/graph 
gmap of rectangles - my macros are described in detail 
here.

The 2nd map is the more traditional geographical map, using 
sas/graph maps.us (and drawn with 'proc gmap').  This map shows
you geographically where the votes for each candidate came from,
but the geographical size of the states can cause a visual bias
(some small states have lots of votes, and some large states
don't have many votes, for example).

Therefore, it is good to look at this type of data in both ways! :)

As an added "bonus", I've added html title= charttips/flyover-text
with the state name and the number of votes, and also html href=
drilldowns so that when you click on a state it takes you to 
a detailed map of that state, showing the votes by county.
(I didn't do the county maps with sas, because I didn't have 
the county-level data ... if I had the data, I could have easily
done those maps too, or course! :)

Back to Samples Index