Reputation: 446
I am trying to perform a visualisation using D3's bar chart graph. Unfortunately, I am having some trouble to get it running as I expect.
Here's a link to what I am seeing: Block Example
Upvotes: 1
Views: 678
Reputation: 102198
For whatever reason, you are overriding the previously set domain for the x scale, which is the one you want (going from 2012 to 2018).
Thus, simply remove this line:
x.domain(data.map(function(d) { return timeFormatter(d.Date); }));
Here is your updated bl.ocks: https://bl.ocks.org/anonymous/be8f59fa47b9ca274934e377ac3d899a
Upvotes: 1