const nameFormat = d3.format('02d'); const data = d3.shuffle(d3.range(0, 20)).map((d, i) => { return { name: `name-${nameFormat(d)}`, value: Math.round(Math.random() * 100), }; }); const size = { width: window.innerWidth, height: window.innerHeight }; const margin = {top: 10, right: 10, bottom: 10, left: 40}; const svg = d3.select('#chart') .attr('width', size.width) .attr('height', size.height);