Merge branch 'master' of https://github.com/kberg/dygraphs
[dygraphs.git] / tests / negative.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
5 <title>negatives</title>
6 <!--[if IE]>
7 <script type="text/javascript" src="../excanvas.js"></script>
8 <![endif]-->
9 <script type="text/javascript" src="../strftime/strftime-min.js"></script>
10 <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
11 <script type="text/javascript" src="../dygraph-canvas.js"></script>
12 <script type="text/javascript" src="../dygraph.js"></script>
13 </head>
14 <body>
15 <p>All negatives (x-axis on top):</p>
16 <div id="g1" style="width:600px; height:200px;"></div>
17
18 <p>Mixed (x-axis in middle):</p>
19 <div id="g2" style="width:600px; height:200px;"></div>
20
21 <p>All positives (x-axis on bottom):</p>
22 <div id="g3" style="width:600px; height:200px;"></div>
23
24 <script type="text/javascript">
25 var negs = [];
26 var mixed = [];
27 var pos = [];
28 for (var i = 0; i < 100; i++) {
29 negs.push([i, -210 + i, -110 - i]);
30 mixed.push([i, -50 + i, 50 - i]);
31 pos.push([i, 1000 + 2 * i, 1100 + i]);
32 }
33
34 new Dygraph(
35 document.getElementById("g1"),
36 negs, { labels: [ 'x', 'y1', 'y2' ] }
37 );
38
39 new Dygraph(
40 document.getElementById("g2"),
41 mixed, { labels: [ 'x', 'y1', 'y2' ] }
42 );
43
44 new Dygraph(
45 document.getElementById("g3"),
46 pos, { labels: [ 'x', 'y1', 'y2' ] }
47 );
48
49 </script>
50 </body>
51 </html>