5 <script type=
"text/javascript" src=
"excanvas.js"></script>
7 <script type=
"text/javascript" src=
"../strftime/strftime-min.js"></script>
8 <script type=
"text/javascript" src=
"../rgbcolor/rgbcolor.js"></script>
9 <script type=
"text/javascript" src=
"../dygraph-canvas.js"></script>
10 <script type=
"text/javascript" src=
"../dygraph.js"></script>
11 <script type=
"text/javascript" src=
"data.js"></script>
14 <h3>Click the buttons to change the zoom
</h3>
15 <h4>Window coordinates (in dates and values):
</h4>
16 <div id =
"dimensions"></div>
17 <div id=
"div_g" style=
"width:600px; height:300px;"></div>
19 <p><b>Zoom operations:
</b></p>
21 <input type=
"button" value=
"Zoom operation 1" onclick=
"sizeGraph(1)">
22 <input type=
"button" value=
"Zoom operation 2" onclick=
"sizeGraph(2)">
23 <input type=
"button" value=
"Zoom operation 3" onclick=
"sizeGraph(3)">
24 <input type=
"button" value=
"Zoom operation 4" onclick=
"sizeGraph(4)">
25 <input type=
"button" value=
"Unzoom" onclick=
"sizeGraph(5)">
29 <script type=
"text/javascript">
31 document.getElementById(
"div_g"),
33 zoomCallback : function(a,b,c,d) { showDimensions(a,b,c,d); }
37 // TODO(konigsberg): Implement a visualization that verifies that initial
38 // displays also show correctly.
40 // Pull an initial value for logging.
41 var minDate = g.xAxisRange()[
0];
42 var maxDate = g.xAxisRange()[
1];
43 var minValue = g.yAxisRange()[
0];
44 var maxValue = g.yAxisRange()[
1];
46 showDimensions(minDate, maxDate, minValue, maxValue);
48 function showDimensions(minDate, maxDate, minValue, maxValue) {
49 var elem = document.getElementById(
"dimensions");
51 "dateWindow : [" + minDate +
" , "+ maxDate +
"],<br>" +
52 "valueRange : [" + minValue +
" , "+ maxValue +
"],";
55 function sizeGraph(i) {
57 case
1: g.doZoomYValues_(
4,
2);
59 case
5: g.doUnzoom_();