forked from mikedewar/d3talk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example1.html
39 lines (39 loc) · 1.17 KB
/
example1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<link type="text/css" rel="stylesheet" href="style.css">
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<title></title>
</head>
<body>
<div id="body">
<div id="header">
Example:
<pre class="prettyprint">
d3.json(
"data.json"
function(json){
d3.select
}
)
</pre>
</div>
<div id="chart">
</div>
<script>
d3.json(
"data.json",
function(json){
console.log(json)
d3.select("chart")
.append("ul")
.selectAll("li")
.data(json)
.append("li")
.attr("text", function(d){d.foo})
}
)
</script>
</div>
</body>
</html>