x Axis functions for getting date on bottom of chart

PHOTO EMBED

Mon Apr 26 2021 20:44:58 GMT+0000 (Coordinated Universal Time)

Saved by @stephanieraymos

  if (xAttribute === "date") {
    const xScale = scaleOrdinal().domain(data.map(dateValue));
    return xScale;
  } else {
    const xScale = scaleLinear()
      .domain(extent(data, yValue))
      .range([innerHeight, 0])
      .nice();
    return xScale;
  }

    const xScale = scaleOrdinal()
      .domain(data.map(dateValue))
content_copyCOPY