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