chart1 = {
const svg = d3.create("svg")
.attr("width", width)
.attr("height", height);
svg
.selectAll('g')
.data(d3.stack().keys(dataStacked.columns.slice(2))(dataStacked))
.join("g")
.attr("fill", d => z(d.key))
.selectAll("path")
.data(d => d)
.join('path')
.attr('d', arcStacked)
.attr('transform', 'translate(450, 450)');
svg
.selectAll('text')
.data( dataStacked )
.join('text')
.text(d => d.Country)
.attr("x", 0)
.attr("y", 0)
.attr("dx", d => y(d.consumption) + 10)
.attr("dy", 5)
.attr("transform", (d, i) => 'translate(' + width/2 + ', ' + height/2 + ') rotate(' + (i * radians_to_degrees(alpha) - 90 + radians_to_degrees(alpha) / 2) + ')')
return svg.node();
}