chart2 = {
const svg = d3.create("svg").attr("viewBox", [-50, 0, width, height + 70]);
svg.append("g").call(yAxis2);
svg.append("g").call(xAxis2);
svg
.selectAll('rect')
.data(fifa2)
.join(enter => enter.append('rect'))
.attr('x', d => xScale2(d.x))
.attr('y', d => yScale2(minY2))
.attr('width', xScale2.bandwidth())
.attr('height', d => 0)
.transition()
.duration(1000)
.attr('fill', d => colorScale2(d.color))
.attr("y", d => yScale2(d.y))
.attr("height", d => yScale2(minY2 - 1) - yScale2(d.y));
svg
.append("text")
.attr("class", "x label")
.attr("text-anchor", "middle")
.attr("x", width / 2)
.attr("y", height + 60)
.text("Name");
svg
.append("text")
.attr("class", "y label")
.attr("text-anchor", "end")
.attr("x", -height / 2.75)
.attr("y", 6)
.attr("transform", "rotate(-90)")
.text("Overall Score");
svg
.append("text")
.text("Name Vs Overall Score")
.style("text-anchor", "middle")
.attr("transform", `translate(${width / 2}, 100)`)
.style("font-size", "1.5em");
return svg.node();
}