3 <title>callbacks
</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>
13 <p>Hover, click and zoom to test the callbacks:
</p>
14 <div id=
"div_g" style=
"width:600px; height:300px;"></div>
16 <div id=
"status" style=
"width:100%; height:200px;"></div>
18 <script type=
"text/javascript">
19 s = document.getElementById(
"status");
20 pts_info = function(x, pts) {
21 var str =
"(" + x +
") ";
22 for (var i =
0; i < pts.length; i++) {
25 str += p.name +
": " + p.xval +
", " + p.yval;
31 document.getElementById(
"div_g"),
37 highlightCallback: function(e, x, pts) {
38 s.innerHTML +=
"<b>Highlight</b> " + pts_info(x,pts) +
"<br/>";
41 clickCallback: function(e, x, pts) {
42 s.innerHTML +=
"<b>Click</b> " + pts_info(x,pts) +
"<br/>";
45 zoomCallback: function(minX, maxX) {
46 s.innerHTML +=
"<b>Zoom</b> [" + minX +
", " + maxX +
"]<br/>";