Data visualization bar chart tooltips

I’m having hard time making it over one final hurdle with this project. I wonder if the cloud has any advice for me.

I have the chart displaying beautifully, and I have the tooltips working - sort of. I can’t get the tooltips to display only the information from the bar that is being hovered over. Essentially, the tooltips just show every year and every GDP calculation. I need some help thinking through how to get them to display only one bar’s info at a time.

Here is a link to my project on Codepen. Thank you in advance for your help.

By logging data and years in the mouseover section I can see you have all the information you need to format the tooltips to display only what you want.

.on("mouseover", function(data) {
      console.log(data, years)

Here you’re just displaying the whole years array:

return "<strong>Year &amp; Quarter</strong>: " + years + "<br><strong>GDP</strong>: $" + GDP

I knew it would be a simple fix. Thanks for the advice.