D3 Tutorial #2

by Johnny Lee

HTML

<ol id="Countries" name="Countries">
</ol>

CSS

body {
  font-family: 微軟正黑體, Arial;
}

JavaScript

var data = [['Taiwan', 36193], ['Japan', 377972], ['Philippines', 300000], ['Indonesia', 1904569]];

d3.select('body #Countries')
	.selectAll()
	.data(data)
  .enter().append('li')
  .text(function(d) { 
		return d[0] + ' ' + d[1];
  })