nv.models.legend - novus/nvd3 GitHub Wiki
A legend consisting of legend labels presented alongside a colored bullet. The bullets have some standard behaviours:
- bullets are selectable, when nothing is selected, will automatically select all
- double-clicking a bullet, will turn all the others off
- optionally act as a radio button (only one selected)
Data
Assumes data of the form:
[ { key: '....' } ]
Attributes
chart.dispatch
chart.options
Methods
chart.margin
chart.width
chart.height
chart.key
chart.color
chart.align
chart.rightAlign
chart.updateState
chart.radioButtonMode
Events
Attach listener using
chart.legend.dispatch.on('legendClick', function(series, index) {
// series properties are color, disabled, key, seriesIndex, values
// index === series.seriesIndex
});