Visualize Data with a Bar Chart: Need help with bar heights

Tell us what’s happening:
For my bar chart data visualization project, all tests pass except for one. The test result states that the bar heights are not accurately representing the GDP values. The following line states: “The heights of the bars should correspond to the data values : expected ‘Infinity’ to equal ‘1959.580’”
I’m really not sure why the test results are getting a value of Infinity. I logged the height results to the console, and all of the results are numbers, not infinity.
Thank you in advance for your help!

Your code so far


Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36.

Link to the challenge:

@ethyl2 I think your stuck is not the height attribute.

This :point_up_2: means you must fix the data values: the x - atribute. The x attribute is not matching with the time data.

Thank you for your feedback. Please explain more – I guess I don’t understand how the time data is involved with the height. The height deals with the y-axis and the gdp numbers. My date data is plotted on the x-axis.

Sorry. Forget my last comment. I had confused data with date.

Your stuck is in the yScale:

var yScale = d3.scaleLinear().
    domain([minY, maxY]).
    range([h - padding, padding]);
    var yAxis = d3.axisLeft(yScale);

Why minY is not 0? :thinking:

For the GDP of 1947 Q1, the height bar is iqual to zero. But the GDP is iqual to 243.1 Billions of Dollars.

My hint: change your minY to zero. Then the height bar to 1947 Q1 is not zero.

Thank you! Changing the value to 0 worked!