Data Visualization Projects - Visualize Data with a Bar Chart

Tell us what’s happening:

I’ve made my code but I keep failing 4 tests.

It says I don’t have a tooltip when I do have one and that the tooltip needs to have an .attr(“data-date”) , but it does…

It also says the info needs to match on the x and y axis but from what I can tell it does.

Also all my dates on the x-axis have commas that I can’t get rid of.

I’m very confused. any help would be appreciated.

Your code so far

bar graph (codepen.io)

Your browser information:

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

Challenge: Data Visualization Projects - Visualize Data with a Bar Chart

Link to the challenge:

Update: I’ve fixed everything except the y-axis. I can’t figure out whats wrong with it.

Here:

  svg
    .selectAll("rect")
    .data(dataset)
    .enter()
    .append("rect")
    .attr("height", (d) => d[1] / 35)
    ...
    .attr("y", (d) => h - d[1] / 35 - 85)

You really need to set y and height attributes utilizing the later defined yScale to match everything.

Thank you! That seems to have done the trick.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.