Need help with Visualize Data with Bar Chart

Hi there,

I am currently doing the 1st project in Data Visualization certification. So far I have managed to pass 12 out of 14 test cases.
I can’t pass the following test cases

#10 The data-date attribute and its corresponding bar element should align with the corresponding value on the x-axis.

I can’t understand how to pass this test case.

Tooltip tests:
#2. My tooltip should have a "data-date" property that corresponds to the "data-date" of the active area.

I don’t know how to add the “data-date” property to a tooltip.

Here is the codepen link:

Any help is appreciated.

Thank you

For the first one you need to make sure the year matches its spot on the x-axis ie. the bar for 1950 should match 1950’s spot on the x-axis.

For the second one add a .attr(‘data-date’, …) on the tooltip.

I hope this was helpful.

1 Like