1 /*global Gallery,Dygraph,data */
2 /*jshint loopfunc:true */
7 name
: 'Synchronization',
8 title
: 'Multiple graphs in sync',
9 setup
: function(parent
) {
11 "<p>Zooming and panning on any of the charts will zoom and pan all the",
13 "<p><aside>(zoom: Click and drag, pan: shift-click and drag, unzoom: double-click)</aside></p>",
15 "<td><div id='div1' style='width:500px; height:300px;'></div></td>",
16 "<td><div id='div3' style='width:500px; height:300px;'></div></td></tr>",
17 "<tr><td><div id='div2' style='width:500px; height:300px;'></div></td>",
18 "<td><div id='div4' style='width:500px; height:300px;'></div></td></table>"].join("\n");
22 var blockRedraw
= false;
23 for (var i
= 1; i
<= 4; i
++) {
26 document
.getElementById("div" + i
),
30 drawCallback
: function(me
, initial
) {
31 if (blockRedraw
|| initial
) return;
33 var range
= me
.xAxisRange();
34 var yrange
= me
.yAxisRange();
35 for (var j
= 0; j
< 4; j
++) {
36 if (gs
[j
] == me
) continue;
37 gs
[j
].updateOptions( {