chart = {
const width = 500,
height = 500;
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
var g = svg.append("g").attr("id", "paths");
var p = svg.selectAll("polyline")
.data(outlines)
.enter()
.append("polyline")
.attr("points", function(d) {return d.pts})
.style("stroke","black")
.style("stroke-width","3px")
.style("fill","rgb(255,0,0)")
.on("mouseover",polyHover)
.on("mouseout",polyHoverOut)
function polyHover(event,d){
d3.select(this).style("fill","purple")
svg
.append("text")
.attr("x","100")
.attr("y","100")
.attr("class","hoverText")
.text(d.sf)
svg
.append("text")
.attr("x","100")
.attr("y","115")
.attr("class","hoverText")
.text(d.occ)
}
function polyHoverOut(){
d3.select(this).style("fill","red")
svg.selectAll("text.hoverText").remove()
}
svg
.append("text")
.attr("x","50")
.attr("y","50")
.text('Total Occupants:'+co2Calc[0])
svg
.append("text")
.attr("x","50")
.attr("y","70")
.text('Total CO2:'+co2Calc[1])
return svg.node();
}