Created
November 15, 2012 20:01
-
-
Save seliopou/4080885 to your computer and use it in GitHub Desktop.
Render some dates
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
var dates = [...], | |
width = ..., | |
height = ...; | |
var xscale = d3.scale.linear().domain([0, dates.length]).range([0, width]); | |
var canvas = d3.select('#canvas') | |
.append('svg:svg') | |
.attr('width', width) | |
.attr('height', height); | |
canvas.selectAll('ticks') | |
.data(dates) | |
.enter().append('svg:text') | |
.attr('x', function(d, i) { return xscale(i); }) | |
.text(function(d) { return d; }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment