Data Visualization with D3 - Add Inline Styling to Elements

I would like to get solid knowledge about computer coding.
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



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

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 11; itel A510W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.85 Mobile Safari/537.36

Challenge: Data Visualization with D3 - Add Inline Styling to Elements

Link to the challenge:

Here’s an example to set the selection’s text color to blue:

.style("color","blue");

instead of color add font-family
and verdana instead of blue

If you like to learn D3.js
here is a good book
D3 in action

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