const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, 200]);
const xAxis = d3.axisBottom(x);
const yAxis = d3.axisLeft(y);
svg.append("g")
.attr("transform", `translate(0, ${height})`)
.call(xAxis);
svg.append("g")
.call(yAxis);
svg
.selectAll("rect")
.data(Barcelona)
.join("rect")
.attr("x", (d) => x(d.price))
.attr("y", (d) => y(d.number_of_reviews))
.attr("width", 1)
.attr("height", 200)
.attr("fill", (d) => c(d.price));
return svg.node();