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


This SAS/Graph example is an imitation of the following map
from the New York Times.

Of course, I didn't have the actual data for the murders, so I had to 
"fake" some plausibly-real data & long/lat locations. 

Also, I didn't have the police precinct maps, so I had to make-do with
the county maps.

But, even with those 2 limitations, I think it came out as a pretty good
proof-of-concept, showing that SAS can certainly be used for this kind
of "crime dashboard" (sounds like something Batman would have in his 
bat-cave, eh? ;)

The map is basically just a regular "choro" map, shading the counties
by the median household income (using fabricated data).  The legend is
slightly customized by using the "offset" to move it into the map area
slightly.  I annotate the dots on the map based on the long/lat values
(remember - when annotating long/lat-specific markers, you have to 
"gproject" the map and the annotate together, so everything will line
up correctly).  The dots are annotated "pies" - each dot is a solid 
black pie, overlaid by an 'empty' gray outline.

The Motive bar chart is a pretty normal "proc gchart" hbar chart.
I right-justify the midpoint labels, and I annotate numeric labels
at the middle of the bar.

The multi-segment bar charts were a little more customized.
They are gchart hbars, with a "subgroup" (to get the multiple
segments).  And all the numbers and labels are carefully annotated,
with alternating positions (above/below), and alternating colors
(black and white), etc.

The charts and maps are all placed on the same page using "proc greplay",
and a custom replay template (as are almost all of my dashboards).

Back to Samples Index