I am trying to replace dayofweek integer to its corresponding names.
var y_label = [...new Set(data.map((item) => item.y))].sort(d3.descending); // [0 - 6]
// Build Y scales and axis:
const y = d3.scaleBand().range([height, 0]).domain(y_label).padding(0.01);
svg.append("g").call(d3.axisLeft(y));
Now I am adding .tickFormat(d3.timeFormat("%A"))
var y_label = [...new Set(data.map((item) => item.y))].sort(d3.descending); // [0 - 6]
// Build Y scales and axis:
const y = d3.scaleBand().range([height, 0]).domain(y_label).padding(0.01);
svg.append("g").call(d3.axisLeft(y).tickFormat(d3.timeFormat("%A")));
What I get is this:
I dont even know where the Thursday comes from. How do I fix my code?