Skip to content
thomassuckow edited this page Jul 9, 2013 · 7 revisions

##Global Object Functions

nv.addGraph({factory})

Constructs a new graph using the given factory method

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

##General Chart Functions

chart.margin({values})

Defines the margin (in pixels) around a chart. Pass an object containing the values

chart.margin({top:10, right:10, bottom:10, left:10})  

chart.width(value)

Defines the width of the chart (without margins) in pixels as rendered in the svg element, not the width of the svg element, itself.

chart.width(960)  

chart.height(value)

see chart.width()


chart.color([values])

Defines the colors used for chart elements where values is an array of rgb, rgba, hex, or string color values. The colors will repeat if there are more chart elements than colors.

##Chart-specific information

Clone this wiki locally