Angular nvd3 : Zooming on a line chart

1.7k Views Asked by At

I am currently implementing a directive that plots a lineChart using Angular nvD3. I am trying to implement a a zoom directly on the graph instead of using the slider that could be found with the lineWithFocusChart.
Instead I plan to click and drag on the graph to zoom just like fusion charts does. Is there a way to do so?

Also, is there a way to retrieve the position of the mouse upon a click on the graph?

Thank you in advance :)

1

There are 1 best solutions below

4
Stoic_Observer On BEST ANSWER

If anyone is still looking, try adding this to your chart options:

zoom: {
    enabled: true,
    scaleExtent: [1, 10],
    useFixedDomain: false,
    useNiceScale: false,
    horizontalOff: false,
    verticalOff: true,
    unzoomEventType: "dblclick.zoom"
}