Data Visualization with D3 - Add Inline Styling to Elements

Tell us what’s happening:

I can not understand where the problem is.If someone have any idea please help.

Your code so far

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

    d3.select('body')
      .selectAll('h2')
      .data(dataset)
      .enter()
      .append('h2')
      .text(d => d + ' USD');
    // Add your code below this line

      .style('font-family', 'verdana');

    // Add your code above this line
  </script>
</body>

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Challenge Information:

Data Visualization with D3 - Add Inline Styling to Elements

if there is a semicolon at the end of this line, what’s style being called on?

don’t you see an error in the console?

1 Like

The error in the console that i was getting was pointing to the .style() method .So i could not understand what was happening.