Let's make an interactive bar chart using jQuery
HTML JavaScript CSS
Latest commit 25b8bcd Mar 12, 2016 @write-this-way Update README.md


Practical data viz in JavaScript

Let's make an interactive bar chart using JavaScript

First things first

  • Highcharts (lots of parameters to make minor changes)
  • Google Charts (robust but constantly changing)
  • D3 (steep learning curve)

So why JavaScript? Actually, it’s jQuery, a JavaScript library with simpler syntax and less code than plain ol' JavaScript

Hosted jQuery: http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js


$(‘body’) .css (‘background’, ‘red’); 


Function changeBackground(color) {
Document.body.style.background = color;
Onload = "changeBackground('red');"

Let's get crackin'

A pollster administered an online survey and collected 19,999 sets of responses to eight questions. Participants were assigned to one of seven groups and could answer 1, 2, or 0 (No Response) to each question. 

The goal: Design a chart to allow readers to compare all groups’ responses of 1 or 2 to all eight questions

The finished product

First taught at NICAR 2016, Denver by Dana Amihere