I'm trying to split a datetime in two variables cx (should be the day in the year) and cy (should be the hour+minute/60) according to:
<!-- date format of d.date: 24-8-2016 9:47:38-->
var parseDayinYearFormat = d3.time.format('%j').parse;
var parseHourFormat = d3.time.format('%H').parse;
var parseMinuteFormat = d3.time.format('%M').parse;
<!-- add the objects-->
var circles = svg.selectAll("circle")
.data(data)
.enter()
.append("circle");
var circleAttributes = circles
.attr("cx", function (d) { return +parseDayinYearFormat(d.date); })
.attr("cy", function (d) { return +parseHourFormat(d.date)+(parseMinuteFormat(d.date)/60); })
.attr("r", function (d) { return 20.0/(9-d.total); })
.attr("class", function (d) {if (d.w>d.total-d.w) {return "cr"} else { return "cb" }});
But d3 isn't playing nice: cx and cy become a NaN and d3 is giving the error Uncaught TypeError: n.apply is not a function
Please help.