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() { |
ramangrover29 | 40636ee | 2013-08-04 22:05:49 -0700 | [diff] [blame^] | 8 | |
| 9 | $.get('/feed/data?dataverse=%s&dataset=%s&feed=%s', function(data) { |
| 10 | feedSeries.append(data[“time”], data[“value”]); |
ramangrover29 | c996e28 | 2013-08-03 14:36:45 -0700 | [diff] [blame] | 11 | }, 500); |
| 12 | |
| 13 | function createTimeline() { |
| 14 | var chart = new SmoothieChart(); |
| 15 | chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 }); |
| 16 | chart.streamTo(document.getElementById("chart"), 500); |
| 17 | } |
ramangrover29 | a04696c | 2013-07-31 21:50:38 -0700 | [diff] [blame] | 18 | </script> |
ramangrover29 | c996e28 | 2013-08-03 14:36:45 -0700 | [diff] [blame] | 19 | </head> |
| 20 | <body onload="createTimeline()"> |
| 21 | |
| 22 | <p>The <em>hello world</em> of <a href="../">Smoothie Charts</a>. View source.</p> |
| 23 | |
| 24 | <canvas id="chart" width="400" height="100"></canvas> |
| 25 | |
ramangrover29 | a04696c | 2013-07-31 21:50:38 -0700 | [diff] [blame] | 26 | </body> |
| 27 | </html> |