Visualize Data with a Heat Map Project - User Story 12 Error

Hello,

I’ve came to strange error with User Story 12 in Heat Map Project
12. My heat map should have multiple tick labels on the x-axis with the years between 1753 and 2015.

Error is : “X axis labels should contain a year that’s at least 1753 : expected ‘2.8’ to be at least 1753”
I can’t figure out form where came this “2.8”.
Here is the code:


(lines 56-75)

I’ve tried to change .domain, .tickValue and .tickFormat. Intersting things i’ve came to is that if i set first value of tickValue less than 1753 (i.e. 1752), then error is:
“…expected ‘1752’ to be at least 1753”
but if first value of tickValue more than 1753 and less than 2016 then error always is:
“…expected ‘2.8’ to be at least 1753”

(not setting tickValue didn’t help too)

Thank you in advance for any help.

Link to the challenge:

I think the 2.8 is coming from the legend. I think somehow the test is looking at the x value of the legend instead of the x axis.

1 Like

Thank you katieyang.
You’ve showed be the right direction.

The error was that there were the wrong id for legend axis.
changed from
.attr('id', 'x-axis')
to
.attr('id', 'legend-axis')

And now everything is fine.

Thanks.