At the point where d3.slect('#chart1 svg')
assign it to a variable(global variable)
myChart = d3.select('#chart1 svg').datum(dat_select).transition()
.duration(1000).call(chart);
So now myChart
contains the nvd3 multiBarHorizontalChart()
chart.
So when you want the chart updated by calling a function updateMyChart()
for example from a place of your choice you could update it like this :
function updateMyChart() {
// myChart is passed to your new data
// myChart also calls chart which hold the attributes you
// had set earlier for multiBarHorizontalChart
myChart.datum(Residence_supply_data).transition().duration(1000).call(chart);
// Update the chart during the window screen resizing
nv.utils.windowResize(myChart.update);
}
Hope this helps you.