chart = {
const svg = d3.create('svg')
.attr('viewBox', [-width/2, -height/2-marginTop, width, height]);
svg.selectAll('path')
.data(pieData)
.join('path')
.attr('d', arc)
.attr('fill', d => color(d.data.key))
.attr('stroke', 'white')
.style('stroke-width', 2);
return svg.node();
}