to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ var stIsIE = /*@cc_on!@*/false; sorttable = { init: function() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); }, makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; if (table.tHead.rows.length != 1) return; // can't cope with two header rows // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, // for backwards compatibility, move them to tfoot (creating it if needed). sortbottomrows = []; for (var i=0; i
Six months ago, we used Google's Fusion Tables to create interactive heat maps to visualize the actual price of a gallon of gasoline across the United States. We're updating that exercise today:
Our first chart visualizes the average price that consumers are paying per gallon of gasoline at the pump when they fill up their vehicle's gas tanks, as of when we sampled it on 21 October 2012 as recorded by GasBuddy:
Of course, the price people pay at the pump is jacked up by the combined total of federal, state and local gasoline excise taxes that are imposed by federal state and local governments. Our next chart shows how much gasoline prices are increased by these taxes on average by state, using data recorded by the American Petroleum Institute:
By contrast, oil companies make about 7 cents in profit for each gallon of gasoline they sell. The U.S. federal government by itself collects 18.4 cents for each gallon of gasoline sold in the United States - about two and a half times the take of what the people who actually work to produce and distribute gasoline across the nation earn.
By subtracting out these combined taxes, we can find the actual price of a gallon of gasoline in each state:
Looking at the map, gasoline prices have fallen the most per gallon in Illinois (-$0.58), Michigan (-$0.49), Indiana (-$0.46), Ohio (-$0.42), Wisconsin (-$0.42) and Missouri (-$0.41) since March 2012. Meanwhile, 12 states saw price drops between $0.20 and $0.31 per gallon, another 9 states saw price drops between $0.11 and $0.19 per gallon, 10 states saw single digit price per gallon drops and the actual price of gasoline is now higher than it was in March 2012 in 13 states.
The Associated Press notes that much of that price drop in the upper midwest is a very recent development:
The average price at the pump fell 22 cents in Ohio and 16 cents in Wisconsin in the past week. Those are two key battleground states in the presidential election, with 18 and 10 electoral votes, respectively.
Here's the electoral vote count for the states that saw the biggest gasoline price drops:
In 2008, Michigan, Ohio, Wisconsin and Missouri were all considered to be battleground states in the presidential election. Three of these states, Michigan, Ohio and Wisconsin are considered to be toss ups for the 2012 election.
Funny how the biggest gasoline price drops by state in 2012 match up so well with that list....
Labels: data visualization
Welcome to the blogosphere's toolchest! Here, unlike other blogs dedicated to analyzing current events, we create easy-to-use, simple tools to do the math related to them so you can get in on the action too! If you would like to learn more about these tools, or if you would like to contribute ideas to develop for this blog, please e-mail us at:
ironman at politicalcalculations
Thanks in advance!
Closing values for previous trading day.
This site is primarily powered by:
The tools on this site are built using JavaScript. If you would like to learn more, one of the best free resources on the web is available at W3Schools.com.