Merge branch 'master' of https://github.com/kberg/dygraphs
[dygraphs.git] / tests / fillGraph.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
5 <title>fillGraph</title>
6 <!--[if IE]>
7 <script type="text/javascript" src="../excanvas.js"></script>
8 <![endif]-->
9 <!--
10 For production (minified) code, use:
11 <script type="text/javascript" src="dygraph-combined.js"></script>
12 -->
13 <script type="text/javascript" src="../dygraph-dev.js"></script>
14
15 </head>
16 <body>
17 <p>Filled, no error bars:</p>
18 <div id="div_g" style="width:600px; height:300px;"></div>
19
20 <p>Filled, negatives:</p>
21 <div id="div_g2" style="width:600px; height:300px;"></div>
22
23 <p>Filled, error bars:</p>
24 <div id="div_g3" style="width:600px; height:300px;"></div>
25
26 <script type="text/javascript">
27 new Dygraph(
28 document.getElementById("div_g"),
29 function() {
30 var ret = "X,Y1,Y2\n";
31 for (var i = 0; i < 100; i++) {
32 ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n";
33 }
34 return ret;
35 },
36 { fillGraph: true }
37 );
38
39 new Dygraph(
40 document.getElementById("div_g2"),
41 function() {
42 var ret = "X,Y1,Y2\n";
43 for (var i = 0; i < 100; i++) {
44 ret += i + "," + (i - 50) +
45 "," + (50 - i * (100-i) * 100/(50*50)) + "\n";
46 }
47 return ret;
48 },
49 { fillGraph: true }
50 );
51
52 new Dygraph(
53 document.getElementById("div_g3"),
54 function() {
55 var ret = "X,Y1,Y2\n";
56 for (var i = 0; i < 100; i++) {
57 ret += i + "," + i + ",10," +
58 (i * (100-i) * 100/(50*50)) + ",5\n";
59 }
60 return ret;
61 },
62 {
63 errorBars: true,
64 fillGraph: true
65 }
66 );
67 </script>
68 </body>
69 </html>