3 <title>synchronize
</title>
5 <script type=
"text/javascript" src=
"excanvas.js"></script>
7 <script type=
"text/javascript" src=
"../dygraph-combined.js"></script>
8 <script type=
"text/javascript" src=
"../dygraph-canvas.js"></script>
9 <script type=
"text/javascript" src=
"../dygraph.js"></script>
10 <script type=
"text/javascript" src=
"data.js"></script>
11 <style type=
"text/css">
12 #div1 { position: absolute; left:
10px; top:
30px; }
13 #div2 { position: absolute; left:
520px; top:
30px; }
14 #div3 { position: absolute; left:
10px; top:
340px; }
15 #div4 { position: absolute; left:
520px; top:
340px; }
19 <p>Zooming and panning on any of the charts will zoom and pan all the
22 <div id=
"div1" style=
"width:500px; height:300px;"></div>
23 <div id=
"div2" style=
"width:500px; height:300px;"></div>
24 <div id=
"div3" style=
"width:500px; height:300px;"></div>
25 <div id=
"div4" style=
"width:500px; height:300px;"></div>
27 <script type=
"text/javascript">
29 var blockRedraw = false;
30 var initialized = false;
31 for (var i =
1; i <=
4; i++) {
34 document.getElementById(
"div" + i),
38 drawCallback: function(me, initial) {
39 if (blockRedraw || initial) return;
41 var range = me.xAxisRange();
42 for (var j =
0; j <
4; j++) {
43 if (gs[j] == me) continue;
44 gs[j].updateOptions( { dateWindow: range } );