Data Visualization with D3 - Change the Presentation of a Bar Chart

Tell us what’s happening:

from the 2nd test case not giving right. while my code is right .

Your code so far

<style>
  .bar {
    width: 25px;
    height: 100px;
    /* Add your code below this line */

margin: 2px ;
    
    /* Add your code above this line */
    display: inline-block;
    background-color: blue;
  }
</style>
<body>
  <script>
    const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];

    d3.select("body").selectAll("div")
      .data(dataset)
      .enter()
      .append("div")
      .attr("class", "bar")
      .style("height", (d) => (d*10 + "px")) // Change this line
  </script>
</body>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Challenge Information:

Data Visualization with D3 - Change the Presentation of a Bar Chart

Hi there!

You need to pass the first test before the second one’s. Add a style function and pass it the margin property and value 2px