Try using scaleTime for your x-axis instead of scaleLinear. I’ve stumbled upon the same issue and this has fixed it for me.
If you haven’t seen scaleTime before you should be able to learn how to use it from D3js docs at this point. You should take a look at d3.timeParse and d3.timeFormat too, it will help you with converting strings to javascript Date objects and you gonna need it to find min and max dates with d3.min and d3.max.
Learning scaleTime seems a must to me, since it’s gonna be used in future d3 projects as well.