score:0

Bind renderData to the buttons at runtime. If you use D3 V6:

d3.selectAll('.buttons > .but').on('click', (e, i) => renderData(i));

For V5 and earlier:

d3.selectAll('.buttons > .but').on('click', (i) => renderData(i));

Related Query

More Query from same tag