I’m encountering some errors that I’m having difficulty troubleshooting and nailing down. One is with the y-axis and the second is with the tooltip functionality.
1 - Y-Axis Issues - When I run the tests, I fail test cases 9 and 11. #9 is “Each bar element’s height should accurately represent the data’s corresponding GDP.” Result = Expected ‘infinity’ to equal '2743.413". #11 is "The data-gdp attribute and its corresponding bar element should align with the corresponding value on the y-axis. Result = "Cannot read property ‘length’ of null.
I’m guessing this are related to eachother, and if I solve one, the other will resolve. When I comb through my data line by line via the tooltip, there’s no odd values appearing. The graph curves visually as I would expect. The only thing I can come up with is that there’s a rounding error due to floating point, but that doesn’t explain why the value being received is “infinity.”
2 - I’m failing both tooltip tests (mouse over to show more info via a tooltip with id=tooltip and tooltip should have a “data-date” property that corresponds to the “data-date” of the active area). I handled the mouse over the same way it was taught in the lessons via combining “title” with “text”. I was reading through other posts that there may be bugs with the test case where it only accepts the mouse over being done via a .on(function(d)…). This leads me to believe the second test case may be failing due to a bug as well.
My CodePen link: https://codepen.io/bloo0178/pen/mGRgaa
Any help is appreciated!