Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dygraphs: How to use both range-selector and manual zooming

If the range-selector is set to true, the manual zooming with the mouse is off. I would like to have both. Is it possible to use both range-selector and manual zooming with the mouse with the dygraphs library? How does this work?

Regards, Wolfgang

like image 309
Wolfgang Meincke Avatar asked Jan 09 '16 15:01

Wolfgang Meincke


1 Answers

When you set the showRangeSelector option, it changes the interaction model for the main chart so that drag=pan. If you don't want this, you can reset it to the default (drag=zoom) explicitly:

new Dygraph(div, data, {
    showRangeSelector: true,
    interactionModel: Dygraph.defaultInteractionModel
});

Here's a full fiddle.

like image 57
danvk Avatar answered Oct 05 '22 22:10

danvk