Visualize Data with a Bar Chart Tooltip Problem

Hi.
I’m try to finish Visualize Data with a Bar Chart and I’m failling the last test on tooltip(13# My tooltip should have a “data-date” property that corresponds to the “data-date” of the active area), and I got undefined on the tooltip representation.

Your code so far

Challenge: Visualize Data with a Bar Chart

Link to the challenge:

Hi @Alincos. Welcome to FCC. According to d3.js documentation, the first argument to your mouseover event handler is the event and second argument is the datum. If you want to access the data use i instead of d like:

tooltip.attr("data-date",i[0])
               .html(`<p>"${i[1]}"<br><em><b>$${i[2]}</b> Billion</em></p>`)

Thanks for the support!