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

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

This is a SAS/Graph verison of Xan's most-excellent looking JMP graph:
http://www.forthgo.com/blog/2007/11/07/chapel-hill-2007-town-council/

Using data copy-n-pasted from here to Excel spreadsheet:
http://www.co.orange.nc.us/elect/2007Municipal/precinct.asp


Xan's description of his original graph:
"Here is a summary graph of the 2007 Chapel Hill Town Council elections. 
Each horizontal bar is a precinct, and the heights are proportional to 
the number of votes cast in each precinct. Each color is a different 
candidate, and the sub-bars widths are proportional to the percent of 
votes that each candidate got in the corresponding precinct. 
Precincts that had too few votes to show up well have been omitted 
(Country Club, Hillsborough, Mail-in, and Provisional)"


My Changes:

Rather than leaving out any of the precincts, I include them all,
even though some of the text labels overlap (if you can't read the 
text labels, you can hover over the bar segments to see the name
in html hover-text).

Rather than just making the height proportional to the number of
votes, I make it the percent of votes (this is possible, because
I am including all the precincts).

Since X and Y axes are both showing %'s, and both go 0-100%,
I make them the exact same length.  Now, not just the width
and height of the bar segments are "analytic" but the *area*
of the bar segments is also analytically meaningful (the area
is proportional to the number of votes).

The precincts in the original graph were not sorted in alphabetical
or numeric order ... in my graph I sort them numerically, based on
the number of votes in that precinct. (I sort the candidates Y-axis
the same as the original, based on the number of total votes each
candidate received.)

I add html mouse-over text to the bar segments.

Back to Samples Index