D3 Scatter Plot - Nothing Displays Again!

Can you please tell me what is wrong with my program? Alerts and console logs don’t work either and nothing at all displays. Thank you

My Codepen link is https://codepen.io/richardvannie/pen/qEWZEWJ

Uncaught (in promise) TypeError: extent is not a function

It looks like you are trying to call an array.

const extent = d3.extent(dataset, (d) => d.Year);
console.log(extent) // array > [1994, 2015]
const format = d3.format("");

const xScale = d3
  .scaleLinear()
  .domain(extent(dataset, (d) => d.Year)) // extent array called as a function
  .range([0, innerWidth]);
alert(xScale);

Thank you. It works now.

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