3 <title>Live random data
</title>
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>
13 <h3 style=
"width:800px; text-align: center;">Live random data
</h3>
14 <div id=
"div_g" style=
"width:800px; height:400px;"></div>
16 <script type=
"text/javascript">
19 for (var i =
10; i
>=
0; i--) {
20 var x = new Date(t.getTime() - i *
1000);
21 data.push([x, Math.random()]);
24 var g = new Dygraph(document.getElementById(
"div_g"), data,
28 valueRange: [
0.0,
1.2],
29 labels: ['Time', 'Random']
31 setInterval(function() {
32 var x = new Date(); // current time
33 var y = Math.random();
35 g.updateOptions( { 'file': data } );
40 <p>This test is modeled after a
<a
41 href=
"http://www.highcharts.com/demo/?example=dynamic-update&theme=default">highcharts
42 test
</a>. New points should appear once per second. Try zooming and
43 panning over to the right edge to watch them show up.
</p>