| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="stylesheet" href="../css/dygraph.css"> |
| 5 | <title>Stock chart</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 | <script type="text/javascript" src="data.js"></script> |
| 13 | </head> |
| 14 | <body> |
| 15 | <h2>Stock Chart demo</h2> |
| 16 | <div id="stock_div" style="width: 800px; height: 400px;"></div> |
| 17 | |
| 18 | <script type="text/javascript"> |
| 19 | g = new Dygraph(document.getElementById("stock_div"), |
| 20 | stockData, |
| 21 | { |
| 22 | customBars: true, |
| 23 | logscale: true |
| 24 | }); |
| 25 | |
| 26 | function setLog(val) { |
| 27 | g.updateOptions({ logscale: val }); |
| 28 | document.getElementById("linear").disabled = !val; |
| 29 | document.getElementById("log").disabled = val; |
| 30 | } |
| 31 | </script> |
| 32 | |
| 33 | <br/> |
| 34 | <div style="width: 800px; text-align: center;"> |
| 35 | <input id="linear" type="button" value="Linear Scale" onClick="setLog(false)" /> |
| 36 | |
| 37 | <input id="log" type="button" value="Log Scale" onClick="setLog(true)" disabled=true /> |
| 38 | </div> |
| 39 | </body> |
| 40 | </html> |