Visualization tooltip wrong text

Tell us what’s happening:
So I have added the title elements as best I could so far. But when I run it; all of my bars have the value on the tooltip. Yet when I submit it; the challenge says everything is fine.
Your code so far

.bar:hover {
  fill: brown;
  const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];

  const w = 500;
  const h = 100;

  const svg ="body")
                .attr("width", w)
                .attr("height", h);

     .attr("x", (d, i) => i * 30)
     .attr("y", (d, i) => h - 3 * d)
     .attr("width", 25)
     .attr("height", (d, i) => d * 3)
     .attr("fill", "navy")
     .attr("class", "bar")
     // Add your code below this line
      .text((d) => d);

     // Add your code above this line

     .text((d) => d)
     .attr("x", (d, i) => i * 30)
     .attr("y", (d, i) => h - (d * 3 + 3))

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0.

Challenge: Add a Tooltip to a D3 Element

Link to the challenge:

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