chart = {
const width = 1000;
const height = 800;
const margin = ({top: 20, right: 0, bottom: 30, left: 40});
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
const x = d3.scaleBand()
.domain(Asistencia2.map(d => d.NumeroTemporada))
.range([margin.left, width - margin.right])
.padding(0.1);
const y = d3.scaleLinear()
.domain([0, d3.max(Asistencia2, d => d.Asistencia)])
.nice()
.range([height - margin.bottom, margin.top]);
const line = d3.line()
.x(d => x(d.NumeroTemporada) + x.bandwidth() / 2)
.y(d => y(d.Asistencia));
svg.append("path")
.datum(Asistencia2)
.attr("fill", "none")
.attr("stroke", "steelblue")
.attr("stroke-width", 1.5)
.attr("d", line);
svg.append("g")
.attr("transform", `translate(0,${height - margin.bottom})`)
.call(d3.axisBottom(x).tickFormat(d3.format("d")));
svg.append("g")
.attr("transform", `translate(${margin.left},0)`)
.call(d3.axisLeft(y));
return svg.node();
}