I'm using the lineWithFocusChart.js model shown in the nvd3 examples shown here: http://nvd3.org/examples/lineWithFocus.html
I want to be able to get access to the values that the user selects in the brushExtent
(slightly related see here) and then apply the focus to all other lineAndFocus charts.
I can do so for the line-chart part with this:
chart.lines.dispatch.on('elementClick.customNameSpace', function(e) {
console.log('click', e);
});
Is there something similar for the brushExtent
?
EDIT1: I can control where it focuses using this code. Editing this example here
chart.brushExtent([10,20])
chart.update()
EDIT2: This is what I am looking for, now I just need to put it all together,(i.e. draw the graph,listen for changes, then draw the graph with the changes...)
chart.dispatch.on('brush.update', function(b) {
console.log(b.extent[0], b.extent[1]);
});