function update(selectedGroup) {

             // Create new data with the selection?
             var dataFilter = data.map(function(d){return {time: d.time, value:d[selectedGroup]} })

             // Give these new data to update line
             line
                 .datum(dataFilter)
                 .transition()
                 .duration(1000)
                 .attr("d", d3.line()
                   .x(function(d) { return x(+d.time) })
                   .y(function(d) { return y(+d.value) })
                 )
           }
// A function that update the chart
A function that update the chart
A function that update the chart
function update(selectedGroup) {
             var dataFilter = data.map(function(d){return {time: d.time, value:d[selectedGroup]} })
             line
                 .datum(dataFilter)
                 .transition()
                 .duration(1000)
                 .attr("d", d3.line()
                   .x(function(d) { return x(+d.time) })
                   .y(function(d) { return y(+d.value) })
                 )
           }
function update ( selectedGroup ) { var dataFilter = data . map ( function ( d ) { return { time : d . time , value : d [ selectedGroup ] } } ) line . datum ( dataFilter ) . transition ( ) . duration ( 1000 ) . attr ( "d" , d3 . line ( ) . x ( function ( d ) { return x ( + d . time ) } ) . y ( function ( d ) { return y ( + d . value ) } ) ) }
A function that update the chart
A function that update the chart
// Create new data with the selection? // Give these new data to update line