Learn About SVG in D3 Help

Tell us what’s happening:

Your code so far


<style>
  svg {
    background-color: pink;
  }
</style>
<body>
  <script>
    const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
    
    const w = 500;
    const h = 100;
    
    const svg = d3.select("body")
                  // Add your code below this line
                  svg
                  .append("svg")
                  .altr("height",h)
                  .altr("width",w);
                  //.style("background-color",pink);
                  
                  
                  // 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/72.0.3626.121 Safari/537.36.

Link to the challenge:

Good try :slight_smile:

You won’t need this line since you are appending svg to the body after this line.

Also you have typos. It’s not .altr but it’s .attr

thanks silly mistake , this always happen to me …

1 Like

Everyone makes mistakes :slight_smile:

1 Like