chartAlternative = {
const svg = d3
.create("svg")
.attr("width", width)
.attr("height", height);
const names = [playerSelect1, playerSelect2];
const x_scale = d3
.scaleBand()
.domain([0, 1])
.range([margin.left, width - margin.right]);
const x_axis = d3
.axisBottom()
.scale(x_scale)
.tickFormat(count => names[count]);
let x_axisNames = svg
.append("g")
.attr("transform", `translate(0, ${height - margin.bottom})`);
x_axisNames.call(x_axis);
const data_scale = d3
.scaleLinear()
.domain([0, 100])
.range([height - margin.bottom, margin.top]);
const y_axis = d3.axisLeft().scale(data_scale);
let y_axisValues = svg
.append("g")
.attr("transform", `translate(${margin.left}, 0)`);
y_axisValues.call(y_axis);
svg
.append("g")
.attr("fill", "steelblue")
.selectAll("rect")
.data(nestedData4)
.join("rect")
.transition()
.ease(d3.easeCubicIn)
.duration(400)
.attr("x", x_scale(1) + x_scale.bandwidth() / 4)
.attr("y", data_scale(nestedData4[0].children.winrate))
.attr("height", data_scale(0) - data_scale(nestedData4[0].children.winrate))
.attr("width", x_scale.bandwidth() / 2);
svg
.append("g")
.attr("fill", "steelblue")
.selectAll("rect")
.data(nestedData3)
.join("rect")
.transition()
.ease(d3.easeCubicIn)
.duration(200)
.attr("x", x_scale(0) + x_scale.bandwidth() / 4)
.attr("y", data_scale(nestedData3[0].children.winrate))
.attr("height", data_scale(0) - data_scale(nestedData3[0].children.winrate))
.attr("width", x_scale.bandwidth() / 2);
return svg.node();
}