4 <title>Live random data
</title>
6 For production (minified) code, use:
7 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
9 <script type=
"text/javascript" src=
"../dygraph-dev.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>