Created
July 26, 2012 12:16
-
-
Save caillou/3181719 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<style type="text/css"> | |
path { | |
fill: none; | |
stroke: black; | |
} | |
</style> | |
</head> | |
<body> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript"> | |
var data = [ | |
{date: new Date(2012,1,1)}, | |
{date: new Date(2012,5,1)} | |
]; | |
var xExtent = d3.extent(data, function (d) { | |
return d.date; | |
}); | |
var xScale = xScale = d3.time.scale() | |
.domain(xExtent) | |
.range([0, 700]); | |
var xAxis = d3.svg.axis() | |
.scale(xScale) | |
.ticks(9); | |
var svg = d3.select("body").append("svg") | |
.attr("width", 700) | |
.attr("height", 50) | |
.append("g") | |
.call(xAxis); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment