Merge pull request #2 from witsa/master
[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 on a per-series basis:</p>
24 <div id="div_g3" style="width:600px; height:300px;"></div>
25
26 <script type="text/javascript">
27 var g1 = 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 var g2 = 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 var g3 = 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 + "," + (i * (100-i) * 100/(50*50)) + "\n";
58 }
59 return ret;
60 },
61 {
62 Y1: { fillGraph: true }
63 }
64 );
65 </script>
66 </body>
67 </html>