Hey, I’ve finished the Bar Chart project, but one test (#10 - x-axis) keeps failing:
I’ve noticed that when i change y-axis ticks format, test fails for this axis too (#11), but i still an’t figure it out whats wrong with x-axis.
Please help me find out whether the problems lies in my code or in test suite.
Have a closer look at how you account for the padding.
const xScale = d3.scaleTime()
.domain([new Date(minDate), (new Date(maxDate))]).range([0, w-2*padding]);
I’m working on the data visualisation projects now. I saw your old post about the bar chart project. Your codepen is helping me a lot. In case you still care…your last error can be fixed by using the xScale for your rect.attr(“x”), but be sure to convert d to Date(). Now you can pass 14/14.
return xScale(new Date(d)); //use xScale, pass test
return (padding + i * (w - 2 * padding) / data.length); //calculate on the fly using i, fails test