Skip to content

Instantly share code, notes, and snippets.

@jhaubrich
Created August 2, 2012 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhaubrich/3232349 to your computer and use it in GitHub Desktop.
Save jhaubrich/3232349 to your computer and use it in GitHub Desktop.
not a line chart
<html>
<head>
<title>not a line chart</title>
</head>
<body>
<script src="http://d3js.org/d3.v2.js"></script>
<script>
var data =
[
{
"key":"brw-a",
"values":[
["2012-07-11T00:00:00", 0.0 ],
["2012-07-11T23:59:59", 0.0 ],
["2012-07-05T06:31:47", 0.0 ],
["2012-07-05T23:59:59", 0.0 ]
]
},
{
"key":"brw-c",
"values":[
["2012-07-11T00:00:00", 0.0 ],
["2012-07-07T00:00:00", 2.0 ],
["2012-07-05T23:59:59", 4.0 ]
]
}
]
var p = d3.select("body").selectAll("p")
.data(data)
.enter().append("p")
.attr("id", function(d) { return d.key})
.text(function(d) {return d.key +": " + '[' + d.values + ']'})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment