| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9"> |
| 5 | <title>dygraph</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>1: Line chart with axis at zero problem:</p> |
| 18 | <div id="graph1"></div> |
| 19 | <script type="text/javascript"> |
| 20 | new Dygraph(document.getElementById("graph1"), |
| 21 | "Date,Temperature\n" + |
| 22 | "2008-05-07,0\n" + |
| 23 | "2008-05-08,1\n" + |
| 24 | "2008-05-09,0\n" + |
| 25 | "2008-05-10,0\n" + |
| 26 | "2008-05-11,3\n" + |
| 27 | "2008-05-12,4\n" |
| 28 | ) |
| 29 | </script> |
| 30 | |
| 31 | <p>2: Step chart with axis at zero problem:</p> |
| 32 | <div id="graphd2"></div> |
| 33 | <script type="text/javascript"> |
| 34 | new Dygraph(document.getElementById("graphd2"), |
| 35 | "Date,Temperature\n" + |
| 36 | "2008-05-07,0\n" + |
| 37 | "2008-05-08,1\n" + |
| 38 | "2008-05-09,0\n" + |
| 39 | "2008-05-10,0\n" + |
| 40 | "2008-05-11,3\n" + |
| 41 | "2008-05-12,4\n", |
| 42 | { |
| 43 | stepPlot: true |
| 44 | } |
| 45 | ) |
| 46 | </script> |
| 47 | |
| 48 | <p>3: Line chart with <code>avoidMinZero</code> option:</p> |
| 49 | <div id="graph3"></div> |
| 50 | <script type="text/javascript"> |
| 51 | new Dygraph(document.getElementById("graph3"), |
| 52 | "Date,Temperature\n" + |
| 53 | "2008-05-07,0\n" + |
| 54 | "2008-05-08,1\n" + |
| 55 | "2008-05-09,0\n" + |
| 56 | "2008-05-10,0\n" + |
| 57 | "2008-05-11,3\n" + |
| 58 | "2008-05-12,4\n", |
| 59 | { |
| 60 | avoidMinZero: true |
| 61 | } |
| 62 | ) |
| 63 | </script> |
| 64 | |
| 65 | <p>4: Step chart with <code>avoidMinZero</code> option:</p> |
| 66 | <div id="graphd4"></div> |
| 67 | <script type="text/javascript"> |
| 68 | new Dygraph(document.getElementById("graphd4"), |
| 69 | "Date,Temperature\n" + |
| 70 | "2008-05-07,0\n" + |
| 71 | "2008-05-08,1\n" + |
| 72 | "2008-05-09,0\n" + |
| 73 | "2008-05-10,0\n" + |
| 74 | "2008-05-11,3\n" + |
| 75 | "2008-05-12,4\n", |
| 76 | { |
| 77 | stepPlot: true, |
| 78 | avoidMinZero: true |
| 79 | } |
| 80 | ) |
| 81 | </script> |
| 82 | |
| 83 | </body> |
| 84 | </html> |