I am new to D3.js. I read "Getting Started with D3" by Mike Dewar. I tried the very first example in the book and it does not work. I tore it up. What is wrong with my code here?
In the section <head>:
<script src="http://mbostock.github.com/d3/d3.js"></script>
<script>
function draw(data) {
"use strict";
d3.select("body")
.append("ul")
.selectAll("li")
.data(data)
.enter()
.append("li")
.text(function (d) {
return d.name + ": " + d.status;
});
}
</script>
In <body>:
<script>
d3.json("flare.json", draw);
</script>
And the JSON file:
[
{
"status": ["GOOD SERVICE"],
"name": ["123"],
"url": [null],
"text": ["..."],
"plannedworkheadline": [null],
"Time": [" 7:35AM"],
"Date": ["12/15/2011"]
}
]
user1781186
source
share