Created
February 4, 2014 04:46
-
-
Save sranso/8798286 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. selection an element | |
var chart = d3.select(".chart"); | |
var bar = chart.selectAll("div"); | |
// 2. then we have to join data to that element | |
var data = [4,3,5,33,5,67] | |
var barUpdate = bar.data(data); | |
// 3. enter/update/exit | |
var barEnter = barUpdate.enter().append(); | |
// 4. add/update/remove attr, content, styles, etc | |
barEnter.style("width", function(d){ | |
return d * 10 + "px"; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment