Data Visualization with D3: Change the Color of an SVG Element

Tell us what’s happening:
Hi
I have tried the following code, can any help me please

If I am running the code its give me the following:
// running tests
The bars should all have a fill color of navy.
// tests completed

Your code so far


<body>
<script>
  const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];

  const w = 500;
  const h = 100;

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

  svg.selectAll("rect")
     .data(dataset)
     .enter()
     .append("rect")
     .attr("x", (d, i) => i * 30)
     .attr("y", (d, i) => h - 3 * d)
     .attr("width", 25)
     .attr("height", (d, i) => 3 * d)
     // Add your code below this line
     .attr("fill", "navy")


     // Add your code above 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/70.0.3538.102 Safari/537.36 Edge/18.18363.

Challenge: Change the Color of an SVG Element

Link to the challenge:

Hello there.

Your code passes for me. So, potentially:

  1. Ensure you do not have any browser extensions with access to freeCodeCamp.org. CSS Style extensions will cause the tests to fail.
  2. Use a different browser. Edge is not the most stable. Try Chrome (recommended for fCC)

Hope this helps

Thanks I will try Chrome