chart = {
let mySVG = d3.select(svg);
let midline = mySVG
.attr("height")/2;
let startX = 5;
let spacing = 3;
let sparklines = mySVG.selectAll("lines")
.data(scores)
.join("lines")
.attr("x1", (d,i) => startX + i * spacing)
.attr("x2", (d,i) => startX + i * spacing)
.attr("y1", midline)
.attr("y2", d => midline - +d.UVA_score + +d.Opponent_Score)
.attr("class", d => {
if (d.location == "Charlottesville, Va.") {
return "home";
} else {
return "away";
}
})
}