Heat Map - Test 9 Fails ( and a question more )

For the error, just look at your visualization. The months start at December and end in November and the axis ticks are at the top of each row and not the middle of each row. You may want to try the band scale or adjust your labels and tick positions.

You can log what the scale and axis values are as you generate them by changing

    .attr('x', d => xScale(d.year))

to

    .attr('x', d => {
      console.log(xScale(d.year));
      return xScale(d.year);
    })

or you can run the project locally and you can see the values for the SVG elements in the page source in the browser console.

2 Likes