Skip to content

write-this-way/practical-js-data-viz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##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

jQuery

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

JavaScript

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

About

Let's make an interactive bar chart using jQuery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published