Created
August 2, 2012 01:56
-
-
Save jhaubrich/3232409 to your computer and use it in GitHub Desktop.
not a line
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
<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