From da1e90572aab1fb7c60aadc59fb20f021c2f569b Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 10 Sep 2017 01:34:57 -0400 Subject: [PATCH] positioning circles horizontally --- app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index a935540..12ada1c 100644 --- a/app.js +++ b/app.js @@ -36,7 +36,7 @@ var xScale = d3.scaleTime(); xScale.range([0,WIDTH]); xScale.domain([new Date('2017-10-1'), new Date('2017-10-31')]); -var parseTime = d3.timeParse("%B%e, %Y"); -console.log(parseTime('October 2, 2017')); -var formatTime = d3.timeFormat("%B%e, %Y"); -console.log(formatTime(new Date('2017-10-1'))); +d3.selectAll('circle') + .attr('cx', function(datum, index){ + return xScale(parseTime(datum.date)); + });