peltier_jacket/main.js

19 lines
541 B
JavaScript
Raw Normal View History

2016-10-14 01:58:31 +03:00
console.log("bla")
var gauge = document.getElementById('temp-gauge');
// Randomly add a data point every 500ms
var random = new TimeSeries();
setInterval(function() {
var nr = Math.random() * 100;
random.append(new Date().getTime(), nr);
gauge.dataset.value = nr;
}, 500);
function createTimeline() {
var chart = new SmoothieChart();
chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 });
chart.streamTo(document.getElementById("chart"), 500);
}
createTimeline();