nv.addGraph - novus/nvd3 GitHub Wiki

nv.addGraph( generator, callback )
nv.addGraph( { generate: generator, callback: callback } )

Schedules a new graph to be rendered using the given generator method. The callback argument is optional. It will be called with the generated chart as its only argument. The callback is called immediately following graph generation, and before generation of any other graphs that may be scheduled for generation.

nv.addGraph(function(){
  var chart = nv.models.lineChart();
  //...
  d3.select("svg").call(chart);
  return chart;
});