My heat map can't pass tests with y-axis but chart looks right

Tell us what’s happening:
I can’t seem to get two tests to pass for my heat map data visualization. I was wondering if someone could point out what I am doing wrong? The results look correct to me.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36.

Link to the challenge:

1 Like

Your y-axis from the top starts with December, should start with January. It ends with January, should end with December. Does that look right?

Not quite. But I don’t think that is the source of the failing test.

The test error is “data-month should be at most 11: expected ‘12’ to be at most 11”. Even when I limit my y-axis range to just January to December, I get the same problem. I’m not sure why data-month is expecting only 11, when there’s data for 12 months.

The other error I have is that “month values don’t line up with y locations : expected false to be true”, but when I check the values, I’m pretty sure the correct data is lining up with the correct month.

image

I can’t spend much time digging into the issue deeper right now but you use setUTCMonth, in utc Jan. is 0, Dec. is 11. So the test expects Dec. to equal 11, not 12. Look into that.
https://www.w3schools.com/jsref/jsref_setutcmonth.asp