Created
October 4, 2016 14:29
-
-
Save yay/53f5b9bde8bdfe5d223cc10344c1aef6 to your computer and use it in GitHub Desktop.
D3 4.x: axis & time scale issue
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 now = new Date(); | |
var then = new Date(); | |
then.setDate(now.getDate() + 7); | |
var axis = d3.axisTop().ticks(d3.timeDays).tickFormat(d3.timeFormat('%b %d')); | |
var scale = d3.scaleTime().domain([now, then]).range([0, 500]); | |
axis.scale(scale); | |
d3.select(document.body).append('svg').append('g').call(axis); // TypeError: t.range is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment