| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="stylesheet" href="../css/dygraph.css"> |
| 5 | <title>fillGraph</title> |
| 6 | <!-- |
| 7 | For production (minified) code, use: |
| 8 | <script type="text/javascript" src="dygraph-combined.js"></script> |
| 9 | --> |
| 10 | <script type="text/javascript" src="../dist/dygraph.js"></script> |
| 11 | |
| 12 | </head> |
| 13 | <body> |
| 14 | <p>Filled, no error bars:</p> |
| 15 | <div id="div_g" style="width:600px; height:300px;"></div> |
| 16 | |
| 17 | <p>Filled, negatives:</p> |
| 18 | <div id="div_g2" style="width:600px; height:300px;"></div> |
| 19 | |
| 20 | <p>Filled on a per-series basis:</p> |
| 21 | <div id="div_g3" style="width:600px; height:300px;"></div> |
| 22 | |
| 23 | <script type="text/javascript"> |
| 24 | var g1 = new Dygraph( |
| 25 | document.getElementById("div_g"), |
| 26 | function() { |
| 27 | var ret = "X,Y1,Y2\n"; |
| 28 | for (var i = 0; i < 100; i++) { |
| 29 | ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n"; |
| 30 | } |
| 31 | return ret; |
| 32 | }, |
| 33 | { fillGraph: true } |
| 34 | ); |
| 35 | |
| 36 | var g2 = new Dygraph( |
| 37 | document.getElementById("div_g2"), |
| 38 | function() { |
| 39 | var ret = "X,Y1,Y2\n"; |
| 40 | for (var i = 0; i < 100; i++) { |
| 41 | ret += i + "," + (i - 50) + |
| 42 | "," + (50 - i * (100-i) * 100/(50*50)) + "\n"; |
| 43 | } |
| 44 | return ret; |
| 45 | }, |
| 46 | { fillGraph: true } |
| 47 | ); |
| 48 | |
| 49 | var g3 = new Dygraph( |
| 50 | document.getElementById("div_g3"), |
| 51 | function() { |
| 52 | var ret = "X,Y1,Y2\n"; |
| 53 | for (var i = 0; i < 100; i++) { |
| 54 | ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n"; |
| 55 | } |
| 56 | return ret; |
| 57 | }, |
| 58 | { |
| 59 | series: { |
| 60 | Y1: { fillGraph: true } |
| 61 | } |
| 62 | } |
| 63 | ); |
| 64 | </script> |
| 65 | </body> |
| 66 | </html> |