ramangrover29 | a04696c | 2013-07-31 21:50:38 -0700 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <script type="text/javascript" src="/webui/static/js/smoothie.js"></script> |
ramangrover29 | a04696c | 2013-07-31 21:50:38 -0700 | [diff] [blame] | 4 | <script type="text/javascript"> |
| 5 | |
ramangrover29 | c996e28 | 2013-08-03 14:36:45 -0700 | [diff] [blame^] | 6 | var random = new TimeSeries(); |
| 7 | setInterval(function() { |
| 8 | random.append(new Date().getTime(), Math.random() * 10000); |
| 9 | }, 500); |
| 10 | |
| 11 | function createTimeline() { |
| 12 | var chart = new SmoothieChart(); |
| 13 | chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 }); |
| 14 | chart.streamTo(document.getElementById("chart"), 500); |
| 15 | } |
ramangrover29 | a04696c | 2013-07-31 21:50:38 -0700 | [diff] [blame] | 16 | </script> |
ramangrover29 | c996e28 | 2013-08-03 14:36:45 -0700 | [diff] [blame^] | 17 | </head> |
| 18 | <body onload="createTimeline()"> |
| 19 | |
| 20 | <p>The <em>hello world</em> of <a href="../">Smoothie Charts</a>. View source.</p> |
| 21 | |
| 22 | <canvas id="chart" width="400" height="100"></canvas> |
| 23 | |
ramangrover29 | a04696c | 2013-07-31 21:50:38 -0700 | [diff] [blame] | 24 | </body> |
| 25 | </html> |