Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created February 17, 2015 15:28
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 tmcw/84041d75095e8912bd21 to your computer and use it in GitHub Desktop.
Save tmcw/84041d75095e8912bd21 to your computer and use it in GitHub Desktop.
(function() {
d3.select(document.body).append('h3').text('Select only Years');
var yearOutput = d3.select(document.body).append('h2');
d3.select(document.body)
.append('div')
.call(
chroniton()
.domain([new Date('1/1/2000'), new Date('1/1/2015')])
.width(500)
.on('change', function(d) {
yearOutput.text(d3.time.year(d));
}));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment