chart676 = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height_2])
.style("overflow", "visible");
const tooltip = d3.select("body").append("div")
.style("position", "absolute")
.style("visibility", "hidden")
.style("background", "white")
.style("border", "solid")
.style("border-width", "1px")
.style("border-radius", "5px")
.style("padding", "10px");
const path = svg.append("g")
.attr("fill", "none")
.attr("stroke", "#0000FF")
.attr("stroke-width", 0.6)
.attr("stroke-opacity", 0.3)
.selectAll("path")
.data(data_life.series)
.join("path")
.style("mix-blend-mode", "normal")
.attr("d", d => line(d.values))
.on("mouseover", function(event, d) {
tooltip.style("visibility", "visible")
.text(`País: ${d.country}`);
d3.select(this).raise();
d3.selectAll('path')
.transition()
.duration(200)
.style("opacity", 0.1);
d3.select(this)
.transition()
.duration(200)
.style("opacity", 1)
.attr("stroke-width", 2);
})
.on("mousemove", function(event) {
tooltip.style("top", (event.pageY-10)+"px")
.style("left",(event.pageX+10)+"px");
})
.on("mouseout", function() {
tooltip.style("visibility", "hidden");
d3.selectAll('path')
.transition()
.duration(200)
.style("opacity", 0.3)
.attr("stroke-width", 0.6);
});
svg.append("g")
.call(y_axis);
svg.append("g")
.call(x_axis);
svg.call(hover, path);
return svg.node();
}