score:1

Accepted answer

Make the drawing of the chart a function so it can be called at will.

var draw = function(data_source) {...

Call the function on a change of the drop-down.

<select name="data" onchange="change(this.value)">

Clear the SVG and draw a new chart.

function change(value) {
  svg.selectAll("*").remove();
  draw(value);
}

Plunk


Related Query