D3 function to parse the date not working
In D3 3.5, you could parse just the way you did, setting the time format...
var formatDate = d3.time.format("%d-%b-%y");
...and then using this time format to parse:
d.date = formatDate.parse(d.date);
But, using D3 4.0, you have to parse dates in a different way, using timeParse
:
var parseTime = d3.timeParse("%d-%b-%y");
And, then, modifying your accessor function:
function type(d) {
d.date = parseTime(d.date);
d.Flux = +d.Flux;
return d;
}