4 <meta http-equiv=
"X-UA-Compatible" content=
"IE=EmulateIE7; IE=EmulateIE9">
5 <title>Live random data
</title>
7 <script type=
"text/javascript" src=
"../excanvas.js"></script>
10 For production (minified) code, use:
11 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
13 <script type=
"text/javascript" src=
"../dygraph-dev.js"></script>
17 <h3 style=
"width:800px; text-align: center;">Live random data
</h3>
18 <div id=
"div_g" style=
"width:800px; height:400px;"></div>
20 <script type=
"text/javascript">
23 for (var i =
10; i
>=
0; i--) {
24 var x = new Date(t.getTime() - i *
1000);
25 data.push([x, Math.random()]);
28 var g = new Dygraph(document.getElementById(
"div_g"), data,
32 valueRange: [
0.0,
1.2],
33 labels: ['Time', 'Random']
35 setInterval(function() {
36 var x = new Date(); // current time
37 var y = Math.random();
39 g.updateOptions( { 'file': data } );
44 <p>This test is modeled after a
<a
45 href=
"http://www.highcharts.com/demo/?example=dynamic-update&theme=default">highcharts
46 test
</a>. New points should appear once per second. Try zooming and
47 panning over to the right edge to watch them show up.
</p>