throw 'Invalid invocation of Dygraph.synchronize(). Need >= 1 argument.';
}
- var OPTIONS = ['selection', 'zoom'];
+ var OPTIONS = ['selection', 'zoom', 'syncRange'];
var opts = {
selection: true,
- zoom: true
+ zoom: true,
+ syncRange: true
};
var dygraphs = [];
// Listen for draw, highlight, unhighlight callbacks.
if (opts.zoom) {
- attachZoomHandlers(dygraphs);
+ if (opts.syncRange) {
+ attachZoomHandlers(dygraphs,true);
+ }
+ else {
+ attachZoomHandlers(dygraphs,false);
+ }
}
if (opts.selection) {
};
// TODO: call any `drawCallback`s that were set before this.
-function attachZoomHandlers(gs) {
+function attachZoomHandlers(gs,syncRange) {
var block = false;
for (var i = 0; i < gs.length; i++) {
var g = gs[i];
var yrange = me.yAxisRange();
for (var j = 0; j < gs.length; j++) {
if (gs[j] == me) continue;
- gs[j].updateOptions( {
- dateWindow: range,
- valueRange: yrange
- });
+ if (syncRange) {
+ gs[j].updateOptions( {
+ dateWindow: range,
+ valueRange: yrange
+ });
+ }
+ else {
+ gs[j].updateOptions( {
+ dateWindow: range
+ });
+ }
}
block = false;
}