()
| 6 | let time; |
| 7 | |
| 8 | function render () { |
| 9 | if (smoothie) smoothie.stop(); |
| 10 | $('chart').width = document.body.clientWidth; |
| 11 | smoothie = new SmoothieChart(); |
| 12 | smoothie.streamTo($('chart'), 1000); |
| 13 | time = new TimeSeries(); |
| 14 | smoothie.addTimeSeries(time, { |
| 15 | strokeStyle: 'rgb(255, 0, 0)', |
| 16 | fillStyle: 'rgba(255, 0, 0, 0.4)', |
| 17 | lineWidth: 2 |
| 18 | }); |
| 19 | } |
| 20 | |
| 21 | // socket |
| 22 | const socket = io(); |