Data Vis Projects - Bar Chart Test 9

I haven’t implemented the tooltip yet, so those tests are obviously failing. But this test 9 has me confused:

9. Each bar element's height should accurately represent the data's corresponding GDP

AssertionError: The heights of the bars should correspond to the data values : expected ‘Infinity’ to equal ‘3609.753’

There is no data value 3609.753 in the json.data. Where is this number coming from? For that matter, where is ‘infinity’ coming from?

1 Like

Oh boy. Those tests…

OK, there is no data with that value, but I’m assuming the test wants you to use scales so it adapts to the canvas you built.

Try finding the error that way. If you have problems, reach me and maybe I can help you.

Good luck with the tests on this module! :slight_smile:

I figured it out. As usual, it’s something not very easy to think of while reading the cryptic output thrown by the tests.

Just one change in your yScale domain will make your code pass the tests. Try to fix it now :slight_smile:

Again, if you can’t solve it, just let me know.

2 Likes

I got it immediately with your help, thanks.

Now…on to the tooltip.

1 Like