Data Visualization: Bar Chart Project User Story #13

Hello all,

I’m working on the Bar Chart project.

I’m passing all of the tests except for user story #13. I’m not entirely sure what that requirement is wanting, but I think I have it? Here is a link to my CodePen. What I think are relevant snippets are below. Let me know what I’m doing wrong, and any advice, even if unrelated.

var tooltip = d3.tip()
.attr(“id”, “tooltip”)
.html((d, i)=>“Date: “+d[0]+”, GDP: $”+d[1].toFixed(0)+" billion")
.attr(“data-date”, (d,i)=>dataset[i][0])

svg.call(tooltip)

svg.selectAll(“rect”)

.on(“mouseover”, tooltip.show)
.on(“mouseout”, tooltip.hide)

Hello there.

Pay particular attention to this section of code:

.html((d, i) => "Date: " + d[0] + ", GDP: $" + d[1].toFixed(0) + " billion")
.attr("data-date", (d, i) => dataset[i][0]);

Do some debugging here.

Hope this helps

1 Like

Thank you! Got them where they needed to be, and I’m passing all the tests!