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 <input type=
"button" value=
"Clear list" onclick=
"javascript:document.getElementById('status').innerHTML=''" />
17 <input type=
"checkbox" id=
"highlight" checked
><label for=
"highlight"> Show 'highlight' events
</label>
18 <div id=
"status" style=
"width:100%; height:200px;"></div>
20 <script type=
"text/javascript">
21 s = document.getElementById(
"status");
22 pts_info = function(x, pts) {
23 var str =
"(" + x +
") ";
24 for (var i =
0; i < pts.length; i++) {
27 str += p.name +
": " + p.xval +
", " + p.yval;
33 document.getElementById(
"div_g"),
39 highlightCallback: function(e, x, pts) {
40 if (document.getElementById('highlight').checked) {
41 s.innerHTML +=
"<b>Highlight</b> " + pts_info(x,pts) +
"<br/>";
45 clickCallback: function(e, x, pts) {
46 s.innerHTML +=
"<b>Click</b> " + pts_info(x,pts) +
"<br/>";
49 zoomCallback: function(minX, maxX) {
50 s.innerHTML +=
"<b>Zoom</b> [" + minX +
", " + maxX +
"]<br/>";
53 drawCallback: function(g) {
54 s.innerHTML +=
"<b>Draw</b> [" + g.xAxisRange() +
"]<br/>";